title: Why are changes to a list made in a sub-process not showing up in the parent process?
body: <p>I am creating a sub-process for reading a growing log file. I passed a counter ( inside of a list) into the <code>log_file_reader</code> function, and append 1 to the counter list if the line is valid. I check the counter in the main process every 5 seconds. The counter in the increases as expected in the sub-process, but it is always 0 in the main process. I checked the id of the counter; it is identical both in sub-process and main process. Why isn't the counter increasing in the main process? If i change counter to <code>counter = multiprocessing.Queue()</code> and check the <code>qsize()</code> in <code>log_file_reader(...)</code> or the main thread,  everything is working fine.</p>
  
  <pre><code>import subprocess
  import select
  import multiprocessing
  import time
  
  
  def log_file_reader(filename, counter):
      f = subprocess.Popen(['tail', '-F',filename], stdout=subprocess.PIPE,stderr=subprocess.PIPE)
      p = select.poll()
      p.register(f.stdout)
      while True:
          if p.poll(1):
              line = f.stdout.readline().strip()
              if line:
                  '''appends 1 to counter if line is valid'''
                  counter.append(1)
  
  
  def main():
      counter = list()  # initializes a counter in type list
      # starts up a process keep tailing file
      reader_process = multiprocessing.Process(target=log_file_reader, args=("/home/haifzhan/logfile.log", counter))
      reader_process.start()
  
      # main thread check the counter every 5 seconds
      while True:
          time.sleep(5)
          print "periodically check---counter:{0},id:{1}".format(len(counter), id(counter))
  
  
  if __name__ == "__main__":
      # everything starts here
      main()
  </code></pre>