← All courses

Concurrency in Python

Threading, multiprocessing, and asyncio — from the GIL to structured concurrency, start to finish.

pythonconcurrencyasynciothreadingintermediate
85decks
127main cards
660practice cards
20%with images
v1.0.0version

Card type mix

What's covered

  1. Concurrency Models Comparison
  2. Workload Types (I/O-Bound vs. CPU-Bound)
  3. Global Interpreter Lock (GIL) Mechanics
  4. GIL Impact on Workloads
  5. Circumventing & Modern Evolution of the GIL
  6. Creating & Managing Threads
  7. Thread Execution Synchronization (join)
  8. Main vs. Worker vs. Daemon Threads
  9. Thread Metadata & Identity
  10. Thread Communication & Return Values
  11. Race Conditions & Critical Sections
  12. Mutual Exclusion (threading.Lock)
  13. Reentrant Locking (threading.RLock)
  14. Deadlocks & Lock Ordering
  15. Atomic Operations & Built-in Thread Safety
  16. Event Signaling (threading.Event)
  17. Conditional Synchronization (threading.Condition)
  18. Resource Throttling (threading.Semaphore)
  19. Delayed Execution (threading.Timer)
  20. Thread-Local Storage (threading.local)
  21. Process Creation & Execution
  22. Memory Isolation: Threads vs. Processes
  23. Process Start Methods (fork, spawn, forkserver)
  24. Platform-Specific Process Behaviors
  25. Process Exit Codes & Error Handling
  26. Inter-Process Queues (multiprocessing.Queue)
  27. Inter-Process Pipes (multiprocessing.Pipe)
  28. Basic Shared Memory (Value & Array)
  29. Modern Shared Memory (multiprocessing.shared_memory)
  30. Process Managers (multiprocessing.Manager)
  31. Inter-Process Locking (multiprocessing.Lock)
  32. Reentrant Inter-Process Locking (multiprocessing.RLock)
  33. Inter-Process Events & Semaphores
  34. Process Synchronization Barriers (multiprocessing.Barrier)
  35. Worker Process Teardown Patterns
  36. Executor Pool Selection
  37. Task Submission Mechanics (submit vs. map)
  38. Pool Context Management & Lifecycle
  39. Pool Sizing & Resource Management
  40. Queue Backpressure in Executors
  41. Future Objects Core Lifecycle
  42. Non-Blocking Future Checks & Timeouts
  43. Future Completion Callbacks
  44. Handling Collections of Futures
  45. Task Cancellation Mechanics
  46. Async Syntax & Coroutines
  47. The Event Loop Paradigm
  48. Yielding Control in Coroutines
  49. Event Loop Starvation & Blocking
  50. Coroutines vs. Synchronous Functions
  51. Task Instantiation (asyncio.create_task)
  52. Coroutines vs. Tasks vs. Futures in Asyncio
  53. Concurrent Task Gathering (asyncio.gather)
  54. Out-of-Order Async Results (asyncio.as_completed)
  55. Async Task Cancellation Mechanics
  56. Async Timeouts & Deadlines
  57. Structured Concurrency (asyncio.TaskGroup)
  58. Exception Groups in Async Contexts
  59. Multi-Task Waiting Strategies
  60. Shielding Async Tasks from Cancellation
  61. Async Mutual Exclusion (asyncio.Lock)
  62. Async Throttling (asyncio.Semaphore)
  63. Async Signaling (Event & Condition)
  64. Async Queues (asyncio.Queue)
  65. Sync Lock Errors in Async Code
  66. High-Level Async Network Streams
  67. Async Stream Readers & Writers
  68. Transports & Protocols (Low-Level Async)
  69. Async Subprocesses
  70. Asynchronous HTTP Clients
  71. Offloading CPU Tasks from Async (run_in_executor)
  72. Modern Thread Offloading (asyncio.to_thread)
  73. Dedicated Event Loop Threads
  74. Sync-to-Async Bridge
  75. Thread-Safe Async Scheduling
  76. Producer-Consumer Pattern Architecture
  77. Queue Implementation Selection
  78. Queue Completion & Joining
  79. Graceful Shutdown & Poison Pills
  80. Bounded Queues & Backpressure
  81. Common Concurrency Bugs
  82. Profiling Concurrent Code
  83. Asyncio Debug Mode
  84. Signal Handling & Graceful Teardown
  85. Concurrency Selection Decision Tree

Example cards

media card

What does 'concurrency' mean in programming?

  • Structuring a program so multiple tasks can make progress over the same period of time
  • Running a program twice as fast on one CPU core
  • Writing code with no bugs
  • Storing data in a database
media card

What's the difference between concurrency and parallelism?

  • Concurrency is about structure (dealing with many things); parallelism is actually doing many things at the same instant
  • They are exactly the same concept with two names
  • Parallelism only applies to networking code
  • Concurrency requires multiple CPU cores

Latest: Initial release — 85 decks, 914 cards, each pack with a preview card teaching the concept before its graded main card and practice cards.