- 4.1. Introduction/Motivation
- 4.2. Threads and Processes
- 4.3. Threads and Python
- 4.4. The thread Module
- 4.5. The threading Module
- 4.6. Comparing Single vs. Multithreaded Execution
- 4.7. Multithreading in Practice
- 4.8. Producer-Consumer Problem and the Queue/queue Module
- 4.9. Alternative Considerations to Threads
- 4.10. Related Modules
- 4.11. Exercises
4.10. Related Modules
Table 4-6 lists some of the modules that you can use when programming multithreaded applications.
Table 4-6. Threading-Related Standard Library Modules
Module |
Description |
threada |
Basic, lower-level thread module |
threading |
Higher-level threading and synchronization objects |
multiprocessingb |
Spawn/use subprocesses with a “threading” interface |
subprocessc |
Skip threads altogether and execute processes instead |
Queue |
Synchronized FIFO queue for multiple threads |
mutexd |
Mutual exclusion objects |
concurrent.futurese |
High-level library for asynchronous execution |
SocketServer |
Create/manage threaded TCP or UDP servers |