News for hackers. Stuff that matters.
Re:Thread pools: How do I use them? by bpicolo on Sunday March 27, 2016 @03:58PM (#11371273)
> Here's what that looks like in Python.

Although python multithreading outside of IO tasks or dropping into C code that drops the GIL isn't going to parallelize, the latter of which is the only way you're going to burn up cores. The API does make it seem simple though.

Re:Thread pools: How do I use them? by delroth on Sunday March 27, 2016 @04:47PM (#11371493)
The example is using multiprocessing.pool.ThreadPool which does not have the GIL problem you mention (at the cost of making it harder to share data).
Re:Thread pools: How do I use them? by aftbit on Sunday March 27, 2016 @06:30PM (#11371819)
You're thinking multiprocessing.Pool. I think ThreadPool actually uses threads and does hit the GIL.
Re:Thread pools: How do I use them? by someguy1234 on Sunday March 27, 2016 @05:13PM (#11371586)
ThreadPool would lock the GIL, wouldn't it? I think multiprocessing.Pool uses processes and that's where you can avoid the GIL (each process gets its own) at the cost of making data sharing harder.

Even with the GIL, ThreadPools are still fine performance-wise for tasks that release the GIL such as I/O or a number of functions in numpy and scipy.