Re: The GIL and PyEval_RestoreThread

2023-09-27 Thread Peter Ebden via Python-list
The thread variable I'm passing in is the one I originally got from calling Py_NewInterpreter. I'd assumed that I didn't need to particularly track the one I get back from SaveThread since it should always be the one I restored previously (which does seem to be the case). > It looks like you're re

Re: The GIL and PyEval_RestoreThread

2023-09-26 Thread MRAB via Python-list
On 2023-09-26 14:20, Peter Ebden via Python-list wrote: Hi all, I've been working on embedding Python and have an interesting case around locking with PyEval_RestoreThread which wasn't quite doing what I expect, hoping someone can explain what I should expect here. I have a little example (I'm

The GIL and PyEval_RestoreThread

2023-09-26 Thread Peter Ebden via Python-list
Hi all, I've been working on embedding Python and have an interesting case around locking with PyEval_RestoreThread which wasn't quite doing what I expect, hoping someone can explain what I should expect here. I have a little example (I'm running this in parallel from two different threads; I hav