Skip to main content
πŸ”’ Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial β†’
⚑
← Coursesβ€ΊSenior Deep-DivesModule 1 Β· Concurrency internals Β· Recapβ€ΊπŸŽ― Review: Senior Python module 1 recapscenario22 / 105
+80 XP
Task
Build a small `pick_concurrency(work_type)` that returns one of `"thread"`, `"process"`, or `"asyncio"`: - `"io_bound"` β†’ `"asyncio"` (modern Python's default for I/O) - `"cpu_bound"` β†’ `"process"` (GIL means threads can't parallelise pure-Python compute) - `"network_io"` β†’ `"asyncio"` (same family as io_bound β€” high concurrency at low overhead) - `"file_io_legacy"` β†’ `"thread"` (sync stdlib like `open()` doesn't release the GIL the way socket I/O does; ThreadPool is the pragmatic fix) - anything else β†’ `"thread"` (safe default: doesn't require event-loop discipline)
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
πŸ“Š Result
Press Run to see result...

πŸ’¬ Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…