[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DYNAMIC-WIND vs. multi-processing

Before DYNAMIC-WIND was incorporated into R5RS, process switching
could be trivially implemented using CALL-WITH-CURRENT-CONTINUATION.
Except for top-level variables, CALL-WITH-CURRENT-CONTINUATION
captured the whole state of a computation.

With DYNAMIC-WIND, state is alterred when a continuation is called
which is outside its dynamic scope (for instance to a separate
computation).  This means that a separate primitive construct will be
needed in order to implement process switching in R5RS Scheme.

Alternately, one might say that users should just avoid the use of
DYNAMIC-WIND if they want to multi-process.  But does the user really
have control over all uses of DYNAMIC-WIND?  A library or
implementation defined function might use it and the user would be
"continuation unsafe" in R4RS Scheme.  Are there others?