https://dbader.org/python-tricks ► Write better & cleaner code using Python's advanced features
In this tutorial you'll learn how to do parallel programming in Python using functional programming principles and the "multiprocessing" module.
We'll take the example data set based on an immutable data structure that we previously transformed using the built-in "map" function. But this time we'll process the data it 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 learn how to use the "multiprocessing.Pool" class and it's parallel "map" implementation that makes parallelizing most Python code that's written in a functional style a breeze.
As part of this video we'll build a little testbed program first 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.
Stay tuned for the next video in the series where you'll learn how to make your Python programs multithreaded using the "concurrent.futures" module as an alternative way to implement concurrency.
FREE COURSE – "5 Thoughts on Mastering Python" https://dbader.org/python-mastery
SUBSCRIBE TO THIS CHANNEL: https://dbader.org/youtube
* *
► Python Developer MUGS, T-SHIRTS & MORE: https://nerdlettering.com
► PythonistaCafe – A peer-to-peer learning community for Python developers: https://www.pythonistacafe.com
FREE Python Coding Tutorials & News:
» Python Tutorials: https://dbader.org
» Python News on Twitter: / @dbader_org
» Weekly Tips for Pythonistas: https://dbader.org/newsletter
» Subscribe to this channel: https://dbader.org/youtube
Auf dieser Seite können Sie das Online-Video Functional Programming in Python: Parallel Processing with "multiprocessing" mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Real Python 04 Oktober 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 59,856 Mal angesehen und es wurde von 1.1 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!