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

Đang mở
#101,014 2 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
distributed-systems

Hướng nghiên cứu

Bắt đầu với multiprocessing.managers.SharedMemoryManager và tài liệu multiprocessing.shared_memory được liên kết trong issue. Xem xét các PR được liên kết gh-102170 và gh-102171, sau đó xác minh rằng các đối tượng do manager tạo ra hỗ trợ hành vi name= được yêu cầu đối với các tiến trình cần truy cập chúng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

3.13 topic-multiprocessing type-feature

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
Ngôn ngữ chính
Python
Star
77.2k
Fork
36k
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
558

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python/cpython

Tất cả issue của python/cpython

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.