Hi,

Last time I looked at PyEval_AcquireLock(), it was used in the wild,
but I don't recall exactly where, sorry :-( Before removing the
functions, I suggest to first notify impacted projects of the incoming
removal, and maybe even propose a fix. I suggest to attempt to follow
the process that I proposed in the PEP 620:
https://www.python.org/dev/peps/pep-0620/#process-to-reduce-the-number-of-broken-c-extensions

For a concrete example, see this JEP issue:
https://github.com/ninia/jep/issues/229

Getting rid of PyEval_AcquireLock() and PyEval_ReleaseLock() in JEP
doesn't seem trivial. This project uses subinterpreters and uses/used
daemon threads.


At least, I tested with my pythonci project (*) and it's possible to
build Cython, numpy and lxml without PyEval_AcquireLock() and
PyEval_ReleaseLock() (they don't use these functions).

(*) https://github.com/vstinner/pythonci


Previously, PyEval_ReleaseLock() was used by
PyThreadState_DeleteCurrent(). I introduced a new
_PyEval_ReleaseLock() function which takes a tstate parameter, so
Python no longer uses PyEval_AcquireLock() and PyEval_ReleaseLock().

commit 23ef89db7ae46d160650263cc80479c2ed6693fb
Author: Victor Stinner <vstin...@python.org>
Date:   Wed Mar 18 02:26:04 2020 +0100

    bpo-39984: _PyThreadState_DeleteCurrent() takes tstate (GH-19051)

    * _PyThreadState_DeleteCurrent() now takes tstate rather than
      runtime.
    * Add ensure_tstate_not_null() helper to pystate.c.
    * Add _PyEval_ReleaseLock() function.
    * _PyThreadState_DeleteCurrent() now calls
      _PyEval_ReleaseLock(tstate) and frees PyThreadState memory after
      this call, not before.
    * PyGILState_Release(): rename "tcur" variable to "tstate".

Victor




Le mer. 1 juil. 2020 à 03:39, Inada Naoki <songofaca...@gmail.com> a écrit :
>
> Hi, folks.
>
> I found PyEval_AcquireLock and PyEval_ReleaseLock are deprecated since
> Python 3.2.
> But the same time, stable ABI is defined in Python 3.2 too.
> The deprecated APIs are stable ABI too because `ceval.h` is not
> excluded from the stable ABI PEP.
>
> As far as my understanding, we can not remove them until Python 4.0. Am I 
> right?
>
> I will add comment like this.
> /* This is a part of stable ABI. Do not remove until Python 4.0 */
>
> Regards,
> --
> Inada Naoki  <songofaca...@gmail.com>
> _______________________________________________
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at 
> https://mail.python.org/archives/list/python-dev@python.org/message/EJF67ZM2HMLWCVKAYNU4JCATO7CRILOS/
> Code of Conduct: http://python.org/psf/codeofconduct/



--
Night gathers, and now my watch begins. It shall not end until my death.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/CLGCJDR6NTL7ILYFRZCATLLB4JU2RGGM/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to