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
— 基于线程的并行
multiprocessing
— 基于进程的并行
concurrent
package
concurrent.futures
— 发起并行任务
subprocess
— 子进程管理
sched
— 事件调度器
queue
— 同步队列类
以下是某些上述服务的支持模块: