As suggested by Guido I am posting a potential solution to the following 
problem for review.

Problem <https://bugs.python.org/issue38119#msg351960>

A quick fix for this problem is to prevent resource tracker from handling 
destruction/unlinking of shared memory. A PR 
<https://github.com/python/cpython/pull/15989> for the same was opened by Davin 
(@applio), and at this moment it is the only implemented solution to fix some 
of the critical issues in shared memory.

But, as soon as resource tracker is removed from the picture cleanup of shared 
memory is dependent on the user itself and this also makes Linux’s shared 
memory behaviour inconsistent with windows. 

Windows uses a reference counting mechanism to count the number of processes 
using a shared memory segment. When all of them are done using it, Windows 
simply unlinks and frees the memory allocated to the shared memory segment. On 
the other hand, in Linux, even after all the processes are done using the 
shared memory segment, the segment will continue to exist unless it is cleaned 
by the respective processes.

Having said that, the current implementation of Linux’s shared memory is also 
not consistent with windows. So, I think it makes sense to go ahead with the 
removal of resource tracker for now until we reach a better solution.

On that note, I have mentioned some of the possible solutions here 
<https://bugs.python.org/msg351445>. Out of these solutions I think 5 is the 
best. This issue and solution 5 is currently being discussed here 
<https://bugs.python.org/issue38119>.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/O67CR7QWEOJ7WDAJEBKSY74NQ2C4W3AI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to