[Aahz, in private mail, provokes an interesting point] > "What happens if you do PyAutoThreadState_Ensure() and > PyEval_InitThreads() has not been called?" > > There should be some discussion of the appropriate time to call > PyEval_InitThreads(). Yeah, this is an interesting, indirect point. If the author must call PyEval_InitThreads(), then they must also have called Py_Initialize(). If in the real world, all users of this API have already done this at process startup, then our internal checks for initialization are pointless. Therefore, I propose that I change the PEP to state that before the AutoThreadState API can be used, Python must have been "correctly initialized", where "correctly initialized" is defined as: * Py_Initialize() has been called. * If the extension is multi-threaded, then PyEval_InitThreads() has been called from the "main thread". If these conditions are not met, Python will either (and hopefully usually) Py_FatalError(), or occasionally dead-lock. Any objections? Mark.
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