Closed gin66 closed 4 years ago
Hi, I like the idea of tying the shmem ownership with the PID to fix the issue with forking on Linux. Hopefully soon when i have time, I will look into adding this logic to the windows code also if required.
Hi, I have finally got to addressing the big safety issues related to the previous version of the crate.
This new version also allows callers to change ownership of the mapping through the Shmem::set_owner
method which should provide what you need to fix your problems with forking.
Thanks !
Using shared memory for process forks lead to forked children calling shm_unlink. With this change, the ownership takes the pid into consideration. This patch changes the behaviour accordingly.