PYTHON CONCURRENCY FOR HIGH-LOAD MULTICORE PROCESSING - Zholdybay, A.T.; Aituov, A. (Bulletin of Abai KazNPU. Series of Physical and Mathematical sciences, 2025)
Python's concurrency techniques for processor-intensive activities on multicore computers are thoroughly evaluated in this article. For workloads that are CPU-bound, I/O-bound, and mixed, we contrast multithreading, multiprocessing, and a hybrid threading + multiprocessing strategy. Execution time, CPU utilization, memory consumption, and realized speedup were measured against a sequential baseline in experimental benchmarks on a multi-core computer. The Global Interpreter Lock (GIL) prevents Python threads from providing any speedup for CPU-bound applications, according to the results. In contrast, numerous processes obtain near linear speedup (3.7× on 4 cores) at the expense of increased memory utilization. Both multiprocessing and multithreading greatly increase throughput (by more than 3× speedup) for I/O-bound tasks by overlapping I/O delays, while threading has a smaller overhead. By overlapping computation and I/O, a hybrid concurrency technique outperforms pure multiprocessing by 3.3×, providing the best performance in a hybrid workload that combines compute and I/O. We examine the findings in light of Amdahl's Law and talk about how Python thread parallelism is essentially constrained by the GIL. Future attempts to eliminate the GIL and its effects on Python's concurrency environment are also discussed in the article. The results emphasize the trade-offs in speed and resource utilization for each strategy on multicore processors and offer recommendations for choosing efficient concurrency strategies in Python.