Skip to content

Instantly share code, notes, and snippets.

View rwarrier243's full-sized avatar

Rahul Warrier rwarrier243

View GitHub Profile
"""
Import this first, before *anything* else, if you are using `multiprocessing`
directly or indirectly and you encounter "freezing" when any threaded code uses
things like NumPy, OpenCV, etc.
This should only be be necessary when using the "fork" start method; other methods
should (hopefully) work fine without it:
https://docs.python.org/3.6/library/multiprocessing.html#contexts-and-start-methods
For more information, see:
https://stackoverflow.com/questions/17053671/python-how-do-you-stop-numpy-from-multithreading # noqa