How to Multi-thread with Python to Speed up Your Code
As Python was first developed 29 years ago, it is unsurprisingly that it was designed more as a linear programming language when single-core CPUs are still dominating the market. In fact, CPython developer may still be feeling the heat when it comes to concurrency. Luckily, we Python noobs can lay back and enjoy the fruits of PEP 371, where multiprocessing was officially added to the standard libraries back in 2008, and PEP 3156 where asyncio made its way to standard libraries in 2012. In the first part of the series on parallelism with Python, we are going to look into multithreading, how to implement it with multiprocessing.
Multi-threading vs Multi-processing
TL;DR: Parallelise a CPU-bound task with multiprocessing, and a I/O-bound task with multithreading

#software-development #data-science #python

Parallelism with Python
1.10 GEEK