[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

Mark Shannon report at bugs.python.org
Tue Mar 17 10:10:55 EDT 2020


Mark Shannon <mark at hotpy.org> added the comment:

Consider the case where a thread that doesn't hold the GIL attempts to get a reference on `None`.

The problem with having a single immortal `None`, is that it will cause data cache thrashing as two different CPUs modify the refcount on the shared `None` object.
Each subinterpreter needs its own distinct `None`.

`None` could be made immortal, it just can't be shared between sub-interpreters.

----------
nosy: +Mark.Shannon

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39511>
_______________________________________


More information about the Python-bugs-list mailing list