threading — Thread-based parallelism — Python 3.11.16 documentation

docs.python.org

Tin mới

Concurrent Execution

multiprocessing — Process-based parallelism

Python Module Index

3.11.16 Documentation

The Python Standard Library

_thread: Low-level threading API.

This module constructs higher-level threading interfaces on top of the lower level _thread module.

concurrent.futures.ThreadPoolExecutor

concurrent.futures.ThreadPoolExecutor offers a higher level interface to push tasks to a background thread without blocking execution of the calling thread, while still being able to retrieve their results when needed.

queue: A synchronized queue class.

concurrent.futures.ThreadPoolExecutor offers a higher level interface to push tasks to a background thread without blocking execution of the calling thread, while still being able to retrieve their results when needed.

asyncio: Asynchronous I/O.

concurrent.futures.ThreadPoolExecutor offers a higher level interface to push tasks to a background thread without blocking execution of the calling thread, while still being able to retrieve their results when needed.

Global Interpreter Lock

WebAssembly platforms

This module does not work or is not available on WebAssembly platforms wasm32-emscripten and wasm32-wasi. See WebAssembly platforms for more information.

Using locks, conditions, and semaphores in the with statement¶

All of the objects provided by this module that have acquire and release methods can be used as context managers for a with statement. The acquire method will be called when the block is entered, and release will be call