Next: Optimistic concurrency, Up: Multithreading
This section describes the threads
structure.
Spawn
constructs 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-timeslice
relinquishes the remaining quantum that the current thread has to run; this allows the current scheduler run the next thread immediately.Sleep
suspends the current thread for count milliseconds.
Terminates the current thread, running all
dynamic-wind
exit points.Terminate-current-thread
obviously does not return.
Threads may be represented and manipulated in first-class thread descriptor objects.
Current-thread
returns the thread descriptor for the currently running thread.Thread?
is the thread descriptor disjoint type predicate.Thread-name
returns the name that was passed tospawn
when spawning thread, or#f
if no name was passed.Thread-uid
returns a thread descriptor's unique integer identifier, assigned by the thread system.