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 davin
Recipients brett.cannon, davin, eric.snow, giampaolo.rodola, lukasz.langa, nascheme, osvenskan, pitrou, pmpp, rhettinger, ronaldoussoren, skrah, terry.reedy, yselivanov
Date 2019-02-16.17:25:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>

> 1) As for SharedMemoryManager, I believe it should live in multiprocessing.managers, not

I am happy to see it live in multiprocessing.managers so long as we can provide a clean way of handling what happens on a platform where we can not support shared memory blocks.  (We have implementations for PosixSharedMemory and NamedSharedMemory which together cover Windows, Linux, MacOS, the *BSDs, and possibly others but that does not cover everything.)

@Neil has already raised this question of what do we want the behavior to be on these unsupported platforms on import?  If everything dependent upon shared memory blocks remains inside, then we could raise a ModuleNotFoundError or ImportError or similar when attempting to `import shared_memory`.  If we move SharedMemoryManager to live in multiprocessing.managers, we need to decide how to handle (and communicate to the user appropriately) its potential absence.  So far, I am unable to find a good example of another module where they have chosen to split up such code rather than keeping it all bottled up inside a single module, but perhaps I have missed something?

> 2) Same for SharedMemoryServer (which is a subclass of multiprocessing.managers.Server).

Same thing as above.  If we decide how to handle the unsupported platforms on import, we can re-organize appropriately.

> 3) ShareableList name is kinda inconsistent with other classes (they all have a "Shared" prefix). I'd call it SharedList instead.

Oooh, interesting.  I am happy to see a name change here.  To share how I came up with its current name:  I had thought to deliberately break the naming pattern here to make it stand out.  The others, SharedMemory, SharedMemoryManager, and SharedMemoryServer, are all focused on the shared memory block itself which is something of a more primitive concept (like accessing SharedMemory.buf as a memoryview) compared to working with something like a list (a less primitive, more widely familiar concept).  Likewise, I thought a dict backed by shared memory might be called a ShareableDict and other things like a NumPy array backed by shared memory might be called a ShareableNDArray or similar.  I was hoping to find a different pattern for the names of these objects-backed-by-shared-memory-blocks, but I am uncertain I found the best name.

> 4) I have some reservations about SharedMemory's "flags" and "mode" args.

It sounds like you are agreeing with what I advocated in msg335660 (up above).  Great!
Date User Action Args
2019-02-16 17:25:39davinsetrecipients: + davin, brett.cannon, nascheme, rhettinger, terry.reedy, ronaldoussoren, pitrou, osvenskan, giampaolo.rodola, skrah, pmpp, lukasz.langa, eric.snow, yselivanov
2019-02-16 17:25:39davinsetmessageid: <>
2019-02-16 17:25:39davinlinkissue35813 messages
2019-02-16 17:25:39davincreate