Next: Optimistic concurrency, Up: Multithreading
This section describes the threads structure.
Spawnconstructs a new thread and instructs the current thread scheduler to commence running the new thread. Name, if present, is used for debugging. The new thread has a fresh dynamic environment.
There are several miscellaneous facilities for thread operations.
Relinquish-timeslicerelinquishes the remaining quantum that the current thread has to run; this allows the current scheduler run the next thread immediately.Sleepsuspends the current thread for count milliseconds.
Terminates the current thread, running all
dynamic-windexit points.Terminate-current-threadobviously does not return.
Threads may be represented and manipulated in first-class thread descriptor objects.
Current-threadreturns the thread descriptor for the currently running thread.Thread?is the thread descriptor disjoint type predicate.Thread-namereturns the name that was passed tospawnwhen spawning thread, or#fif no name was passed.Thread-uidreturns a thread descriptor's unique integer identifier, assigned by the thread system.