A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/047901.html below:

[Python-Dev] Problem with PyGILState_Ensure() and the thread Module

[Python-Dev] Problem with PyGILState_Ensure() and the thread Module [Python-Dev] Problem with PyGILState_Ensure() and the thread ModulePhil Thompson phil at riverbankcomputing.co.uk
Mon Aug 16 21:57:41 CEST 2004
I'm having a problem calling functions in a C extension module that uses 
PyGILState_Ensure() and PyGILState_Release() from a thread created with 
thread.start_new_thread().

A deadlock occurs in PyGILState_Ensure() because it doesn't know anything 
about the thread state created by start_new_thread(). Therefore it creates a 
new one and then calls PyEval_RestoreThread() - but it already holds the GIL 
and so deadlocks.

I would expect the threading PyGILState_Ensure() to know about all thread 
states - not just the ones it creates itself.

Is this a bug, feature, or misunderstanding on my part?

This is with Python 2.4a2.

Thanks,
Phil
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4