chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] On parameterize and fluid-let


From: Tobia Conforto
Subject: Re: [Chicken-users] On parameterize and fluid-let
Date: Mon, 15 Oct 2007 13:27:26 +0200
User-agent: Mutt/1.5.11+cvs20060126

Mark Fredrickson wrote:
> ... we can see the macro expansion of parameterize using dynamic-wind.
> Dynamic-wind will call the function g6 before and after control enters
> or leaves the thunk, by call/cc, the basis of threads in chicken
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

No, I believe threads are orthogonal to continuations.

Many threads can execute the same code and manipulate the same data
"at the same time", and they can pass continuations to each other.

Each thread has its own fluid-let (and parameterize) stack, in fact
SRFI-18 says that "the dynamic-wind stack is part of the dynamic
environment" and that "Each thread has its own dynamic environment."

But ordinary (non parameter) variables are shared among all threads.
So if a thread accesses a variable while another thread is inside a
fluid-let on the same variable, the new, dynamic value will "leak" to
the other thread.  That's what I meant by "non thread-safe".

I've yet to test these conclusions of mine, so I don't have any example
code to back them up.


Tobia




reply via email to

[Prev in Thread] Current Thread [Next in Thread]