by harpiaharpyja · 5y ago · 0 comments
My understanding is that distributing work across multiple threads would not speed up CPU-intensive code anyways. In fact it would add overhead due to threading.
Perhaps you meant I/O bound code?
There are many CPU bound tasks which can be made multithreaded and faster, but it does depend on the task and how much extra coordination you’re adding to make it multithreaded.
The GIL restricts use of multiple hardware threads.
Threads in python will run in the same python process and use only one core.
If you want to use more cores you need to use more python processes.