The bindings described in this section are part of the
Spawncreates a new thread, passes that thread to the current scheduler, and instructs the scheduler to run
thunkin that thread. The
nameargument (a symbol) associates a symbolic name with the thread; it is purely for debugging purposes.
Relinquish-timesliceinstructs the scheduler to run another thread, thus relinquishing the timeslice of the current thread.
Sleepdoes the same and asks the scheduler to suspend the current thread for at least
time-in-millisecondsmilliseconds before resuming it. Finally,
terminate-current-threadterminates the current thread.
Each thread is represented by a thread object. The following procedures operate on that object:
(current-thread) -> thread
(thread? thing) -> boolean
(thread-name thread) -> name
(thread-uid thread) -> integer
Current-threadreturns the thread object associated with the currently running thread.
Thread?is the predicate for thread objects.
Thread-nameextracts the name of the thread, if one was specified in the call to
Thread-uidreturns the uid of the thread, a unique integer assigned by the thread system.
Previous: Creating and controlling threads | Next: Creating and controlling threads