Parallelization with the multiprocessing module

Before jumping onto the discussion of the multiprocessing module, let's first understand what we mean by parallelization. This will be a very short introduction to parallelization, just enough to understand how to use some features of the multiprocessing module.

Introduction to parallelization

Imagine you are standing in a long queue at a checkout counter in a grocery store, waiting for your turn. Now, three more counters are opened to serve the customers and the existing queue is split. As a result, you can pay and get out of the store quickly.

Parallelization, in some sense, accomplishes similar results. In this example, each counter can be imagined as a separate process, carrying out independent ...

Get Learning Python Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.