[issue37185] use os.memfd_create in multiprocessing.shared_memory?

Vinay Sharma report at bugs.python.org
Sun Aug 4 02:37:56 EDT 2019


Vinay Sharma <vinay0410sharma at gmail.com> added the comment:

Hi @pierreglaser,
I recently started using the shared_memory module in multiprocessing , and as you said using memfd_create wouldn't require resource tracking is true. But, I was wondering if these memory segments can't be related/mapped using a unique name, then how will other unrelated processes to which this file descriptor cannot be passed, use this shared memory segment.

Also, would releasing when all the references to the segment are dropped an expected behaviour.

Let's suppose a process creates a shared memory segment and exits. After 5 seconds another process is started, which tries to access the same memory segment. But it won't be able to since all references would have been dropped by the first process, thereby releasing this memory segment.

Feel free to comment, if I misinterpreted anything.

----------
nosy: +vinay0410

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37185>
_______________________________________


More information about the Python-bugs-list mailing list