[r6rs-discuss] [Formal] SRFI-39 should be made an R6RS library
R. Kent Dybvig
dyb at cs.indiana.edu
Mon Feb 12 19:06:57 EST 2007
> If one has non-deterministic interrupts, and continuations, then one has
> threads. As with C's sequencing points, there are (only) specific
> points in the execution of a serial segment of Scheme code where a thread
> switch is permitted but that is a very fine-grained limitation.
> Threads are fine, regardless of implementation, if the effect is "as if"
> we were witnessing an interrupt driven, serial execution of continuations.
That may be desirable for lightweight threads operating on a single
processor, but the overhead of arranging this for a multiprocessor thread
system would likely be prohibitive.
> I think the big thing that is missing, to make things *not hideous*,
> is (I hope I'm using the terminology correctly), delimited continuations.
> In Guile Scheme (even absent true threads), I found it useful to
> have a construct like:
> (call-with-one-shot-continuation (lambda (k) <body>))
These are simply "one-shot" continuations. Delimited continuations (also
called partial continuations or subcontinuations) are something different.
More information about the r6rs-discuss