Armin, > The documentation of PyGILState_Ensure() says, indeed, that it's ok to > call this function even if the current thread already owns the GIL. > If PyPy's version deadlocks in this case, then it's a bug of PyPy. > Please file it as a bug (https://bitbucket.org/pypy/pypy/issues; also > look a bit in case a similar bug would be already reported and waiting > there). You can also try to look in the implementation of > PyGILState_Ensure() to make sure.
Thanks for the response. We found that by adding a 'with nogil' to our Cython we were able to resolve the problem. However, it's a bit error prone. The callback is for logging and the implication is that we have to release the GIL at any point where we call into C++ and log may be output. Since the same callback may also be called from a non Python thread we do need to ensure the GIL from there, so we can't just drop it. >From my point of view, it does seem like a PyPy bug; will check the tracker >and open a bug if there's not already one. Thanks again Nick _______________________________________________ pypy-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-dev
