Re: The GIL and PyEval_RestoreThread

2023-09-27 Thread Peter Ebden via Python-list
" That suggests to me that it should try to acquire the GIL again and wait until it can (although possibly also that it's not an expected use and Python thread states are expected to be more 1:1 with C threads). On Wed, Sep 27, 2023 at 3:53 AM MRAB via Python-list wrote: > On 2023-09

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