This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: dynamic roots and dynamic-wind


Maciej Stachowiak <mstachow@mit.edu> writes:

> scm_internal_cwdr unwinds dynamic-winds on entry, and rewinds them on
> exit. Is there a reason it does that?

I'm not sure that anyone really knows the reason.

But, in any case, to me it seems that there are situations where you
would want to start with a fresh dynamic context, e.g. when spawning
threads.

Long ago, there was a bug report about the thread system relating to
how threads are spawned.  I think I'll have a look at that when the
Christmas holiday starts.  I'll look at this at the same time.

Maybe we could split the current call-with-dynamic-root into a
call-with-dynamic-root which doesn't rewind the dynwind chain, and a
new primitive call-with-dynamic-context which unwinds the chain but
runs under the same root.  (And, maybe, this last primitive isn't
really needed on the Scheme level.)

/mdj