The modules described in this chapter provide support for concurrent execution of code. The appropriate choice of tool will depend on the task to be executed (CPU bound vs IO bound) and preferred style of development (event driven cooperative multitasking vs preemptive multitasking). Here's an overview:
threading
--- Thread-based parallelismmultiprocessing
--- Process-based parallelism- Introduction
- Reference
Process
and exceptions- Pipes and Queues
- Miscellaneous
- Connection Objects
- Synchronization primitives
- Shared
ctypes
Objects - Managers
- Proxy Objects
- Process Pools
- Listeners and Clients
- Authentication keys
- Logging
- The
multiprocessing.dummy
module
- Programming guidelines
- Examples
- The
concurrent
package concurrent.futures
--- Launching parallel tasks- Executor Objects
- ThreadPoolExecutor
- ProcessPoolExecutor
- Future Objects
- Module Functions
- Exception classes
subprocess
--- Subprocess management- Using the
subprocess
Module - Security Considerations
- Popen Objects
- Windows Popen Helpers
- Older high-level API
- Replacing Older Functions with the
subprocess
Module - Legacy Shell Invocation Functions
- Notes
- Using the
sched
--- Event schedulerqueue
--- A synchronized queue class
The following are support modules for some of the above services: