How does Python share memory among multiple processes?

I read that processes operate on seperate memory spaces (link). However the multiprocessing package of python offers shared memory (multiprocessing.Value, multiprocessing.Array).

  • Where (in which process) is this data stored?
  • Is the data accessed by reference by the child processes?

1 answer

  • answered 2017-06-17 18:30 user2357112

    The data is allocated in a shared, anonymous memory map created through the mmap module. You can see the code here and here.