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 steve.dower
Recipients paul.moore, ronny-rentner, steve.dower, tim.golden, zach.ware
Date 2022-03-01.12:17:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <892e6eee-3205-2791-aec0-770177a82f6c@python.org>
In-reply-to <1646134748.49.0.513958523413.issue46888@roundup.psfhosted.org>
Content
Yes, named memory mappings only exist on Windows until the last 
reference is closed, so this is a difference due to the underlying OS. 
The implementation of unlink() recognises this (the entire body is under 
a _USE_POSIX check), but the docs do not reflect it.

The only workaround I can think of would be to create a real file, then 
open it with mmap and give it a tagname, then pass that tagname as the 
name argument of the shared memory object when creating it. It's a bit 
of a pain, but I don't think there's any option on our side given the 
way the API has been designed.

It's not possible for N SharedMemory instances to independently agree 
which one will ignore the close() call and do it in unlink() instead, 
and in any case that still wouldn't "unlink" the name until all other 
references had also been closed.

Can you tell us a bit more about what you're trying to achieve? Perhaps 
knowing how this is actually being relied upon will inspire some ideas 
for how to make it work better.
History
Date User Action Args
2022-03-01 12:17:47steve.dowersetrecipients: + steve.dower, paul.moore, tim.golden, zach.ware, ronny-rentner
2022-03-01 12:17:47steve.dowerlinkissue46888 messages
2022-03-01 12:17:47steve.dowercreate