This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Kallah, eryksun, paul.moore, steve.dower, steven.daprano, tim.golden, zach.ware
Date 2020-01-08.17:53:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1578505984.33.0.961508387754.issue39255@roundup.psfhosted.org>
In-reply-to
Content
> Agreed it's not a bug, but I will say it took me a while to work out 
> *why* it's not a bug (namely, that even though the OP is using shared 
> memory values, the code relies on fork semantics to share the two 
> Value objects that *reference* the shared memory).

The programming guidelines cover this under "explicitly pass resources to child processes" and "the spawn and forkserver start methods". Even for scripts that will only ever use the fork start method, it explains why inheriting globals may be a problem due to garbage collection in the parent. What can be done to make the advice there more visible and easily understood?

I'd guess that, even though it took you a while to spot the problem, you wouldn't make the same mistake if writing this from scratch -- assuming you've read and understood the programming guidelines. There's nothing about an arbitrary Value instance that would allow a spawned child process to map it to the shared memory of a Value in the parent process. That information has to be pickled and sent to the child.
History
Date User Action Args
2020-01-08 17:53:04eryksunsetrecipients: + eryksun, paul.moore, tim.golden, steven.daprano, zach.ware, steve.dower, Kallah
2020-01-08 17:53:04eryksunsetmessageid: <1578505984.33.0.961508387754.issue39255@roundup.psfhosted.org>
2020-01-08 17:53:04eryksunlinkissue39255 messages
2020-01-08 17:53:03eryksuncreate