We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Addressing multithreading and multiprocessing in transparent and Pythonic methods

Formale Metadaten

Titel
Addressing multithreading and multiprocessing in transparent and Pythonic methods
Alternativer Titel
Addressing multithreading and multiprocessing in transparent and Pythonic ways
Serientitel
Anzahl der Teile
132
Autor
Lizenz
CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache

Inhaltliche Metadaten

Fachgebiet
Genre
Abstract
With the increase in computing power, harnessing and controlling one’s code out of the single-threaded realm becomes an ever-increasing problem, coupled with the desire to stay in the Python layer. With the recent tools and frameworks that have been published, escaping the GIL cleanly is much easier than before, allow one’s Python code to effectively utilize multi-core and many core architectures in the most Pythonic ways possible. In this talk, learn about how to utilize static multiprocessing for process pinning, and effectively balancing thread pools with a monkey-patched import of threading modules. Overview: Introduction to multithreading and multiprocessing in Python History of multithreading+multiprocessing in Python, classic frameworks Problems that can occur (oversubscription, nested parallelism issues, process hopping, pool resource on shared machines) Python accessing bigger hardware over the last few years (28+ cores, etc) When to stay in the GIL, and when to escape it The advantages and safety of the GIL Python-level exiting of the GIL; analysis of when to return to single-threaded, and when threading is a deceivingly bad idea Accountability of frameworks that natively exit the GIL The new multithreading and multiprocessing libraries and techniques static multiprocessing module (smp) (and monkey patching of multiprocessing) thread pool control with command line calls of Python ( python -m tbb -p 8) Putting it all together Examples of using static multiprocessing on a large machine to stop oversubscription Example of pseudo-daemon process on 4-core machine by processor pinning Thread pool control on a simple NumPy example Summary - Best practices for using above methods to control multithreading+multiprocessing What needs to be done in the space (frameworks and things that need to be exposed) Problems that still exist in the area Q&A