March 2003
Intermediate to advanced
656 pages
39h 30m
English
The
only part of the thread module that your code
should use directly is the lock objects that module
thread supplies. Locks are simple
thread-synchronization primitives. Technically,
thread’s locks are non-reentrant
and unowned: they do not keep track of what thread last locked them,
so there is no specific owner thread for a lock. A lock is in one of
two states, locked or unlocked.
To get a new lock object (in the unlocked state), call the function
named allocate_lock without arguments. This
function is supplied by both modules thread and
threading. A lock object
L supplies three methods.