[r6rs-discuss] [Formal] SRFI-39 should be made an R6RS library
R. Kent Dybvig
dyb at cs.indiana.edu
Sat Feb 10 12:12:50 EST 2007
> Could you explain what the difference between global and thread
> parameters is in Chez Scheme? I can't find an explanation in the
> online user's manual.
>From Section 13.4:
When a thread parameter is created, a separate location is set aside in
each current and future thread to hold the value of the parameter's
internal state variable. (This location may be eliminated by the
storage manager when the parameter becomes inaccessible.) Changes to the
thread parameter in one thread are not seen by any other thread.
When a new thread is created (see fork-thread), the current value (not
location) of each thread parameter is inherited from the forking thread
by the new thread.
So when a thread parameterizes a thread parameter, it's parameterizing
it's own. It usually makes no sense for one of multiple threads to
parameterize a global parameter.
Kent
More information about the r6rs-discuss
mailing list