December 2000
Intermediate to advanced
816 pages
16h 57m
English
Let's take a look at what the thread module has to offer. In addition to being able to spawn threads, the threadmodule also provides a basic synchronization data structure called a lock object (a.k.a. primitive lock, simple lock, mutual exclusion lock, mutex, binary semaphore). As we mentioned earlier, such synchronization primitives go hand-in-hand with thread management.
Listed in Table 17.1 are a list of the more commonly-used thread functions and LockType lock object methods:
| Function/Method | Description |
|---|---|
| thread Module Functions | |
| start_new_thread(function, args, kwargs=None) | spawns a new thread and execute function with the given args and optional kwargs |
| allocate_lock() | allocates LockType ... |
Read now
Unlock full access