يوفر Python ثلاث نماذج للتزامن، والاختيار الصحيح يعتمد بشكل أساسي على ما إذا كان عملك مرتبطًا بـ I/O أو مرتبطًا بـ CPU — وهو قرار يتأثر بشكل كبير بـ GIL (الذي يمنع المواضي من تنفيذ كود Python بالتوازي).
النماذج الثلاثة
threading → multiple threads, ONE process. GIL-limited for CPU.
multiprocessing → multiple PROCESSES, each its own interpreter/GIL → true parallelism.
asyncio → single thread, cooperative coroutines yielding at await points.
