I propose that thread-local storage is a good idea. I suggest the following
design:
- Within a locale, some variables may be designated as _thread-local_ (TLS).
Mutation of thread-local variables affects only the thread which affected the
mutation.
- TLS designation is a function of _namespace_, not _name_. It is possible to
have a thread-local variable and a shared variable which have the same name.
- When a task is created, it inherits its parent's thread-local variables.
- A thread-local variable named 'x' is referred to using 'x_.'. Similarly
'x_l__.' and 'x__l_.'. A self-effacing reference to a thread-local variable
is given by 'x_.:' etc.
Thoughts?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm