Concurrent Execution¶
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
- Programming guidelines
- Examples
multiprocessing.shared_memoryâ Shared memory for direct access across processes- The
concurrentpackage concurrent.futuresâ Launching parallel tasksconcurrent.interpretersâ Multiple interpreters in the same processsubprocessâ Subprocess managementschedâ Event schedulerqueueâ A synchronized queue classcontextvarsâ Context Variables
The following are support modules for some of the above services: