Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Parallel Processing With multiprocessing: Overview

Give Feedback

In this section, you’ll learn how to do parallel programming in Python using functional programming principles and the multiprocessing module. You’ll take the example data set based on an immutable data structure that you previously transformed using the built-in map() function. But this time you’ll process the data in parallel, across multiple CPU cores using the Python multiprocessing module available in the standard library.

You’ll see, step by step, how to parallelize an existing piece of Python code so that it can execute much faster and leverage all of your available CPU cores. You’ll also learn how to use the multiprocessing.Pool class and its parallel map implementation that makes parallelizing most Python code that’s written in a functional style a breeze.

First, you’ll build a little testbed program that we can use to measure the execution time with the time.time() function, so that we can compare the single-threaded and multithreaded implementations of the same algorithm.

Become a Member to join the conversation.