python / python/cpython

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

オープン
#101,014 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

3.13 topic-multiprocessing type-feature
主要言語
Python
スター
77.2k
フォーク
36k
平均マージ
1日 9時間
マージ済み PR(30日)
558

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

multiprocessing.managers.SharedMemoryManager と、issue にリンクされている multiprocessing.shared_memory のドキュメントから始めてください。リンクされている PR gh-102170 と gh-102171 を確認し、その後、manager が作成したオブジェクトが、それらにアクセスする必要があるプロセス向けに要求された name= の動作をサポートしていることを検証してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
distributed-systems
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。