On Sun, Aug 14, 2011 at 9:26 AM, Guido van Rossum <guido at python.org> wrote: >> These days we have PyGILState_Ensure(): >> http://docs.python.org/dev/c-api/init.html#PyGILState_Ensure >> >> and even dedicated documentation: >> http://docs.python.org/dev/c-api/init.html#non-python-created-threads >> >> ;) > > That is awesome! Although, if it's possible to arrange it, it's still better to do that once and then use BEGIN/END_ALLOW_THREADS to avoid the overhead of creating and destroying the temporary thread states: http://blog.ccpgames.com/kristjan/2011/06/23/temporary-thread-state-overhead/ Still, it's far, far easier than it used to be to handle the GIL correctly from non-Python created threads. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
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