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.

classification
Title: Shared Memory for array of object
Type: behavior Stage:
Components: Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, hannahbusshoff
Priority: normal Keywords:

Created on 2021-02-10 10:13 by hannahbusshoff, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
example.py hannahbusshoff, 2021-02-10 10:13 Example of the problem
Messages (4)
msg386769 - (view) Author: Hannah Busshoff (hannahbusshoff) Date: 2021-02-10 10:13
Dear all, 

When seeking to put an object of type -- Array of object -- into shared memory when doing multiprocessing via starmap, I am encountering problems -- in that sense that the program does not finish running but apparently gets stuck. 

I attached a minimal example. 

Many thanks for your help. I sincerely hope I have not overlooked that this issue has been raised by somebody else. I am happy to provide further input!

Cheers, 

Hannah
msg386780 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2021-02-10 13:49
This looks like a numpy usage question, not a python bug. I suggest you ask on Stackoverflow or a numpy user forum.
msg386783 - (view) Author: Hannah Busshoff (hannahbusshoff) Date: 2021-02-10 14:48
Hi Eric,

Thanks for your quick reply. The numpy operation was only an attempt to serialize the nested list and make it available as a shared memory object.  As is written in the documentation, the SharedList() does not take nested lists as an input. 

I posed the question as well on Stackoverflow with a slightly longer example. Feel free to check it out: https://stackoverflow.com/questions/66138235/multiprocessing-with-array-of-objects-in-shared-memory. 

Thanks again. 

Cheers, 

Hannah
msg386803 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2021-02-10 19:31
If you could demonstrate the problem without numpy, then we could probably help you here. I don't know much about numpy.
History
Date User Action Args
2022-04-11 14:59:41adminsetgithub: 87357
2021-07-07 15:13:35andrei.avksettype: crash -> behavior
2021-02-10 19:31:09eric.smithsetmessages: + msg386803
2021-02-10 14:48:12hannahbusshoffsetmessages: + msg386783
2021-02-10 13:49:45eric.smithsetnosy: + eric.smith
messages: + msg386780
2021-02-10 10:13:44hannahbusshoffcreate