MRAB wrote:
The shared object's refcount would be incremented and the sharing function would return a proxy to the shared object.

Refcounting in the thread/process would be done on the proxy.

When the proxy is closed or garbage-collected, the shared object's refcount would be decremented.

What about other objects accessed through the shared object?
They would need to get wrapped in proxies too.

Also, if the shared object is mutable, changes to it would
need to be protected by a lock of some kind.

Maybe all this could be taken care of by the proxy objects,
but it seems like it would be quite tricky to get right.

--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to