How to implement freelists in dict 3.10 for previous versions?

Marco Sulla Marco.Sulla.Python at gmail.com
Sat Jan 1 13:50:43 EST 2022


Ooookay, I suppose I have to study a little the thing :D

On Thu, 30 Dec 2021 at 07:59, Inada Naoki <songofacandy at gmail.com> wrote:
>
> On Wed, Dec 29, 2021 at 7:25 PM Marco Sulla
> <Marco.Sulla.Python at gmail.com> wrote:
> >
> > I noticed that now freelists in dict use _Py_dict_state. I suppose
> > this is done for thread safety.
> >
>
> Some core-dev are working on per-interpreter GIL. But it is not done yet.
> So you don't need to follow it soon. Your extension module will work
> well in Python 3.11.
>
> > I would implement it also for a C extension that uses CPython < 3.10.
> > How can I achieve this?
>
> See PyModule_GetState() to have per-interpreter module state instead
> of static variables.
> https://docs.python.org/3/c-api/module.html#c.PyModule_GetState
>
>
> --
> Inada Naoki  <songofacandy at gmail.com>


More information about the Python-list mailing list