This module provides low-level primitives for working with multiple threads (a.k.a. light-weight processes or tasks) --- multiple threads of control sharing their global data space. For synchronization, simple locks (a.k.a. mutexes or <#2866#>binary semaphores<#2866#>) are provided.
The module is optional and supported on SGI and Sun Sparc systems only.
It defines the following constant and functions:
Lock objects have the following methods:
Caveats:
KeyboardInterrupt
exception will be received by an arbitrary
thread.
sys.exit(status)
or executing
raise SystemExit, status
is almost equivalent to calling
thread.exit_prog(status)
, except that the former ways of
exiting the entire program do honor finally
clauses in the
current thread (but not in other threads).
sleep
,
read
, select
) work as expected.