CPU Multiprocessing in Python


Making use of multiple CPU cores on your machine can vastly speed up your computing. In Python, it is not technically possible to acheive true parallelism in Python due to the Global Interpretor Lock (GIL), which in Python serializes access to different threads, meaning a single thread in python can never use more than 1 CPU core (see this for more information). However, Python has a number of packages that can help with concurrent programming by using multiple concurrent processes instead of multithreading.

In this lesson we will go over the basics of how you might achieve concurrency in Python with brief examples using the following packages:

And of course, while there are many uses for the Python package threading which has some high-level control over threads, we will not be going over it in this lesson.