title: Is shared readonly data copied to different processes for multiprocessing?
body: <p>The piece of code that I have looks some what like this:</p>
  
  <pre><code>glbl_array = # a 3 Gb array
  
  def my_func( args, def_param = glbl_array):
      #do stuff on args and def_param
  
  if __name__ == '__main__':
    pool = Pool(processes=4)
    pool.map(my_func, range(1000))
  </code></pre>
  
  <p>Is there a way to make sure (or encourage) that the different processes does not get a copy of glbl_array but shares it. If there is no way to stop the copy I will go with a memmapped array, but my access patterns are not very regular, so I expect memmapped arrays to be slower. The above seemed like the first thing to try. This is on Linux. I just wanted some advice from Stackoverflow and do not want to annoy the sysadmin. Do you think it will help if the the second parameter is a genuine immutable object like <code>glbl_array.tostring()</code>.</p>