Solving the problem of mutual recursion

Chris Angelico rosuav at gmail.com
Sun May 26 18:16:34 EDT 2013


On Mon, May 27, 2013 at 5:35 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> I'm pretty sure that CPython uses the GIL regardless of platform.  And
> yes you can have multiple OS-level threads, but because of the GIL
> only one will actually be running at a time.  Other possibilities
> include:

6) It's spinning in a function that has released the GIL. Python
threads can certainly execute concurrently; they just can't be
manipulating Python objects. Most of the I/O functions will release
the GIL before doing a potentially-blocking operation, and some
CPU-heavy functions can do the same (I'm given to understand that
numpy does this) - just depends on having a long job that involves no
refcounted objects.

ChrisA



More information about the Python-list mailing list