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 vinay0410
Recipients davin, eryksun, pitrou, vinay0410
Date 2019-08-22.05:17:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> In terms of providing "consistent behavior across platforms that can be
> reasonably supported", the behavior suggested above could not
> reasonably be supported in Windows.

I understand that persistence of a shared memory segment after all the processes using it exit, can be very difficult on Windows.

But, after testing shared_memory on Windows, the behavior on Windows and Unix is not consistent at the moment.

For instance:
Let's say a three processes P1, P2 and P3 are trying to communicate using shared memory.
 --> P1 creates the shared memory block, and waits for P2 and P3 to access it.
 --> P2 starts and attaches this shared memory segment, writes some data to it and exits.
 --> Now in case of Unix, shm_unlink is called as soon as P2 exits.
 --> Now, P3 starts and tries to attach the shared memory segment.
 --> P3 will not be able to attach the shared memory segment in Unix, because shm_unlink has been called on that segment.
 --> Whereas, P3 will be able to attach to the shared memory segment in Windows

One possible solution can be, to register the shared the shared_memory only when it's created and not when it's attached.

I think that might make Unix's implementation more consistent with windows.

Any thoughts on the same will be very helpful.
Date User Action Args
2019-08-22 05:17:38vinay0410setrecipients: + vinay0410, pitrou, eryksun, davin
2019-08-22 05:17:38vinay0410setmessageid: <>
2019-08-22 05:17:38vinay0410linkissue37754 messages
2019-08-22 05:17:38vinay0410create