Dùng asyncio cho I/O-bound với nhiều concurrent operations (web APIs, DB queries) — single thread, cooperative concurrency, overhead thấp nhất.
- Dùng
threadingcho I/O-bound với thư viện blocking không hỗ trợ async. - Dùng
multiprocessingcho CPU-bound (ML training, image processing, data transformation) — bypass GIL, chạy trên nhiều CPU cores thực sự, nhưng overhead cao hơn (IPC, memory).
Pitfall: asyncio không giúp gì cho CPU-bound — dùng ProcessPoolExecutor kết hợp với asyncio.