0

when I define a variable on a module level, start a new subprocess and modify this variable in the child process, should the change be visible in the parent process? From my experiments, it seems that the answer is 'no' but I'm wandering if I am not missing something.

I'm trying to do this since I need to share large volumes of memory between the parent and child processes and multiprocessing.Queue is way too slow for my purposes.

Deeplearningmaniac
  • 285
  • 1
  • 2
  • 13
  • Possible duplicate of [Python: Possible to share in-memory data between 2 separate processes](http://stackoverflow.com/questions/1268252/python-possible-to-share-in-memory-data-between-2-separate-processes) – Zeugma Aug 31 '16 at 22:35
  • No not unless you create the object once in another file and import it from there – Padraic Cunningham Aug 31 '16 at 22:35
  • Possible duplicate of [Python multiprocessing shared memory](http://stackoverflow.com/questions/14124588/python-multiprocessing-shared-memory) – vz0 Aug 31 '16 at 22:39
  • @PadraicCunningham, can you elaborate on this? – Deeplearningmaniac Aug 31 '16 at 22:56

0 Answers0