python / python/cpython

multiprocessing.managers. SharedMemoryManager should let you name the created object

Open
#101,014 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.13 topic-multiprocessing type-feature
Dominant language
Python
Stars
77.2k
Forks
36k
Avg merge
1d 9h
Merged PRs (30d)
558

Description

Python's new truly-shared memory (https://docs.python.org/3/library/multiprocessing.shared_memory.html) is great, however using the SharedMemoryManager is impractical since the created list or numpy array can't be custom-named.

Why would we want to custom-name?

Well, say process 3 creates a new object and process 5 wants to access it. Without a shared naming protocol, this isn't possible. Process 3 has to read the name for its newly created object and somehow signal it to process 5 in order for process 5 to ever know about it and access it.

We should be able to name the objects created with the SharedMemoryManager, with the name= parameter, same as the syntax for creating those objects without the manager.

Thanks,
Sam

Linked PRs
  • gh-102170
  • gh-102171

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with multiprocessing.managers.SharedMemoryManager and the multiprocessing.shared_memory documentation linked in the issue. Review linked PRs gh-102170 and gh-102171, then verify that manager-created objects support the requested name= behavior for processes that need to access them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.