Message350156
> 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:38 | vinay0410 | set | recipients:
+ vinay0410, pitrou, eryksun, davin |
2019-08-22 05:17:38 | vinay0410 | set | messageid: <1566451058.75.0.501526363848.issue37754@roundup.psfhosted.org> |
2019-08-22 05:17:38 | vinay0410 | link | issue37754 messages |
2019-08-22 05:17:38 | vinay0410 | create | |
|