Alexey Izbyshev <izbys...@ispras.ru> added the comment:

> Ideally, if we don't have to do any work to reacquire the GIL, we shouldn't 
> do any work to preserve the error code either.

Before take_gil() knows whether it has to do any work, it calls 
MUTEX_LOCK(_PyRuntime.ceval.gil.mutex), which is either EnterCriticalSection() 
or AcquireSRWLockExclusive(). So unless we can be sure that those functions 
can't clobber the last error (or we redesign GIL to have a fast-path like an 
atomic compare-exchange in non-contended case), I don't see how we can avoid 
the last error bookkeeping.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33030>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to