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 osvenskan
Recipients brett.cannon, davin, eric.snow, giampaolo.rodola, lukasz.langa, nascheme, osvenskan, pitrou, pmpp, rhettinger, ronaldoussoren, skrah, terry.reedy, yselivanov
Date 2019-02-23.16:34:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <8601E84C-7AC5-41FF-98E8-E5D71A0C1F20@pyspoken.com>
In-reply-to <1550936407.5.0.0820977087216.issue35813@roundup.psfhosted.org>
Content
> On Feb 23, 2019, at 10:40 AM, Giampaolo Rodola' <report@bugs.python.org> wrote:
> 
> 
> Giampaolo Rodola' <g.rodola@gmail.com> added the comment:
> 
>> We are consciously choosing to not support an atomic "create or attach".  This significantly simplifies the API and avoids the valid concerns raised around user confusion relating to that behavior (including the use of different specified 'size' values in a race) but does not preclude our potentially introducing this as a feature in the future.
> 
> I understand that because of *size* we cannot solve the race condition issue unless the user uses some sort of synchronization mechanism. FWIW I bumped into this lib:
> http://semanchuk.com/philip/sysv_ipc/
> ...which provides two separate APIs to "create" and "attach":
> 
>>>> SharedMemory("name", IPC_CREX)
>>>> attach("name")
> 
> At this point I'm agnostic about the API, which is probably just a matter of personal taste (e.g. one may prefer a separate SharedMemory.attach() classmethod or a *mode* argument accepting "x" and "a"). I see that that lib use shmat() on attach and shmdt() on detach. I'm not sure if that makes a difference, just mentioning it because your implementation doesn't do that on close() and perhaps it should.

attach() and detach() are particular to SysV IPC which is different from the POSIX IPC that’s being used here. There’s no need for attach() and detach() with POSIX shared memory. 

POSIX IPC is generally simpler than SysV IPC, in part because it was developed after SysV IPC so the developers had the benefit of experience with the older API.

Side note: I’m the author of the sysv_ipc package you found, as well as the posix_ipc package.
History
Date User Action Args
2019-02-23 16:34:54osvenskansetrecipients: + osvenskan, brett.cannon, nascheme, rhettinger, terry.reedy, ronaldoussoren, pitrou, giampaolo.rodola, skrah, pmpp, lukasz.langa, eric.snow, yselivanov, davin
2019-02-23 16:34:54osvenskanlinkissue35813 messages
2019-02-23 16:34:53osvenskancreate