Next Previous Up Top Contents Index

4.2 Multi-thread semantics

4.2.6 Thread variables

The Threads library provides a new type of variable: a thread variable, also known as a thread-local variable. These variables are similar to normal module variables in the sense that they are visible according to the same scoping rules and have the same semantics in a single-threaded program. However, in contrast to a normal variable, assignments to a thread variable in one thread are not visible when evaluating the variable in another thread.

Whenever a thread is created, the value of each thread variable is initialized to a thread-independent value resulting from a once-only evaluation of the initialization expression of the thread variable definition.

See page 111 for details of the thread adjective to define variable.


Common Dylan and Functional Extensions - 31 Mar 00

Next Previous Up Top Contents Index