home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!cs.utexas.edu!sun-barr!olivea!spool.mu.edu!sgiblab!cs.uoregon.edu!nntpserver!mike
- From: mike@mystix.cs.uoregon.edu (Michael John Haertel)
- Newsgroups: comp.lang.scheme
- Subject: Using memory mapping to implement continuations
- Message-ID: <MIKE.92Dec16130919@mystix.cs.uoregon.edu>
- Date: 16 Dec 92 21:09:19 GMT
- References: <4051@mitech.com> <FEELEY.92Dec14215701@zohar.ai.mit.edu>
- <4067@mitech.com><1992Dec15.201735.21731@netcom.com>
- <GJR.92Dec15214517@klosters.ai.mit.edu>
- <1992Dec16.190713.20460@netcom.com>
- Sender: news@cs.uoregon.edu (Netnews Owner)
- Organization: CS Dept, University of Oregon
- Lines: 23
- In-Reply-To: thinman@netcom.com's message of 16 Dec 92 19:07:13 GMT
-
- A number of articles in the "Are interpreters as fast... " thread
- refer to using page-remapping to implement continuations.
-
- I don't see this as a big benefit. If continuations are implemented
- by stack copying, they're too expensive to use for anything in an
- inner loop (like all those cool backtracking algorithms that use
- continuations). If continuations are implemented by making memory
- mapping system calls (read: trapping to the OS, saving lots of
- registers, going through a hairy VM system locking protocol, frobbing
- the MMU, trashing the cache, unlocking the VM system, restoring lots
- of registers, and returning to user mode) they're STILL too expensive
- to use. In fact, some machines might be able to copy a page or two of
- stack faster than they can make the necessary system calls. (Note that
- copy-on-write for large things like fork() is still a win, because it
- amortizes the system call overhead, but continuations probably involve
- at most a page or two of data on average.)
-
- The only implementation I've ever seen where continuations were cheap
- enough that I'd actually want to use them is SML of NJ. But in that
- implementation it's achieved perhaps at the cost of making procedure
- calls a little more expensive than they should be.
-
- Memory remapping is not free.
-