Concurrency and Processes
asyncio, threading, multiprocessing, concurrent.futures, subprocess, queue, signal and shared memory.
This is an overview — pick a sub-topic below.
Sub-topics (8)
asyncio (module)
Event loop, tasks, timeouts, queues and streams for asynchronous I/O.
threading (module)
Threads, locks, events, conditions, semaphores and timers.
multiprocessing (module)
Processes, pools, queues, pipes and managers for multi-core work.
multiprocessing.shared_memory
Share a block of memory between processes without copying (e.g. a large NumPy array).
concurrent.futures
A simple, uniform API for thread and process pools.
subprocess
Run external programs and capture their output.
queue
Thread-safe FIFO, LIFO and priority queues for producer/consumer designs.
signal
Handle OS signals like Ctrl+C (SIGINT) or SIGTERM for graceful shutdown.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.