title: Cannot utilise multiprocessing shared memory to save output from multiprocessing function
body: <p>I am writing a program to extract information from the web and save it in a Python list. I use a multiprocessing method to extract the information and is experiencing problems saving the output list for further processing. This is my code:</p>
  
  <pre><code>import multiprocessing
  
  def web_scrape1():
      #some codes to scrape the web output 3 lists
      global sub_list1a, sub_list2a, sub_list3a
      sub_list1a.append(scrape1)
      sub_list2a.append(scrape2)
      sub_list3a.append(scrape3)
  
  def web_scrape2():
      #some codes to scrape the web output 3 lists
      global sub_list1b, sub_list2b, sub_list3b
      sub_list1b.append(scrape1)
      sub_list2b.append(scrape2)
      sub_list3b.append(scrape3)
  
  def master_scraper():
      ws1 = multiprocessing.Process(target=web_scrape1)
      ws2 = multiprocessing.Process(target=web_scrape2)
  
      ws1.start()
      ws2.start()
      ws1.join()
      ws2.join()
  
      global master_list1, master_list2, master_list3
  
      master_list1 = sub_list1a + sub_list1b
      master_list2 = sub_list2a + sub_list2b
      master_list3 = sub_list3a + sub_list3b
  
  def postprocessing():
      #some codes to process the lists
      print(master_list1) # Output []
      print(master_list2) # Output []
      print(master_list3) # Output []
  
  def main():
    master_scraper()
    postprocessing()
  
  if __name__ == '__main__':
    multiprocessing.freeze_support()
    main()
  </code></pre>
  
  <p>the output for the above code is simply:</p>
  
  <pre><code>[]
  []
  []
  </code></pre>
  
  <p>I tried to assign all the list to a shared memory using something like this <code>multiprocessing.Array('b', sub_list1a)</code> inside the <code>web_scape1()</code>, <code>master_scraper()</code> and <code>main()</code> function but the list still comes back as <code>[]</code>.</p>
  
  <p>Hope to get some help here.</p>