'In a multithreaded program, are all threads blocked when one thread is doing heavy work inside the Python interpreter?

As far as I understand, if I'm blocking for IO or calling an external library like what happens inside Numpy, then execution of other threads that need the Python interpreter can continue. However, if I'm - for example - doing heavy number crunching inside Python (without utilising Numpy), then that will block the Python interpreter which means all other threads doing similar work will be blocked.

Is that correct? And if so, is there a way to get around it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source