[gambit-list] dynamic scope
Marc Feeley
feeley at iro.umontreal.ca
Sun Feb 1 00:31:28 EST 2009
On 1-Feb-09, at 12:18 AM, lowly coder wrote:
> Re problems in multithreaded programs:
>
> The dynamic environment is composed of two parts: the "local
> dynamic environment" and the "global dynamic environment". There is
> a single global dynamic environment, and it is used to lookup
> parameter objects that can't be found in the local dynamic
> environment.
>
> is that the main reason? that with the parameter method, i'm
> changing the 'local env' (which each thread has it's own) whereas
> with the dynamic-wind method, I'm setting a var in the global env
> (which all the threads share)
In a way yes. Except the global variables are not part of the global
dynamic environment. They are part of the global lexical
environment. But you are correct that the problem is that they are
shared by all threads instead of each thread having his own local
bindings.
Marc
More information about the Gambit-list
mailing list