Python · Concurrency and Parallelism · Intermediate · 30 min read
Python Threads and Thread Pools: ThreadPoolExecutor, Futures, Locks, Queues and Safe Shutdown
Use threads for I/O-bound work correctly. Learn threading.Thread basics, ThreadPoolExecutor with submit, map and as_completed, futures and exception handling, timeouts, locks, RLock, Event, Semaphore and Queue for coordination, race conditions and deadlocks, thread-local data, graceful shutdown, and when to choose threads over asyncio or processes.
Create an account to start
Create a free account to see what this lesson covers
- Every free lesson in every section, in full
- Track your progress and pick up where you left off
- Free practice questions and an incident simulation
- Takes under a minute: name, email and a password
No card needed. Full access to Python is a paid upgrade you can choose later.