27. When to Use Threads vs Processes vs Async
Different concurrency models suit different problems.
Threads
- I/O-bound tasks
- Shared memory
Processes
- CPU-bound tasks
- Isolation and safety
Async
- Many concurrent I/O tasks
- Lightweight, scalable
Wrap-Up
Match the concurrency model to the problem: threads for I/O, processes for CPU, async for scalable I/O.