September 2026
1051 pages
35h 4m
English
For cases in which a program must execute complex but independent tasks, the concurrent.futures module was developed. This module allows you to conveniently execute function calls in threads or processes.
It provides the ThreadPoolExecutor and ProcessPoolExecutor classes, whose instances represent a set of threads and processes respectively. Both classes implement a common interface—namely, that of an executor. An executor is used to process a sequence of tasks, whereby it can make use of several workers—that is, threads or processes.
The interface of an executor comprises the methods listed in Table 31.2.
|
Method |
Description |
|---|---|
|
submit(fn, [*args], {**kwargs}) |
Registers a new task ... |
Read now
Unlock full access