Steve Dower <steve.do...@python.org> added the comment:
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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46888> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com