> On 14 Jun 2020, at 22:59, Ben Rudiak-Gould <benrud...@gmail.com> wrote:
> 
> There isn't really any contention for these memory locations in
> CPython as it stands because only one interpreter thread can run at a
> time. The only time a cache handoff is needed is during a thread
> switch when the new thread is scheduled on a different core, which is
> pretty rare (at CPU timescales). Adding checks to every incref/decref
> would probably cost more time than it would save.

The problem is when you fork a python process.

Each of the child processes you would hope shared the state of the
parent that is not being changed. But because of ref counting
even unchanging objects get modified by a ref count inc/dec cycle
and then the page that the object is in is copy-on-write'ed.

End result is that a children share no pages with the parent.

Barry
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/4JWUL6GJUWPQBKBKSG3H5IKEZJV45HY7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to