title: Python Multiprocessing sharing of global values
body: <p>What i am trying to do is to make use of global variable by each process.
  But my process is not taking the global values</p>
  
  <pre><code>import multiprocessing
  
  count = 0 
  
  def smile_detection(thread_name):
      global count
  
      for x in range(10):
          count +=1
          print thread_name,count
  
      return count    
  
  x = multiprocessing.Process(target=smile_detection, args=("Thread1",))
  y = multiprocessing.Process(target=smile_detection, args=("Thread2",))
  x.start()
  y.start()
  </code></pre>
  
  <p>I am getting output like</p>
  
  <pre><code>Thread1 1
  Thread1 2
  .
  .
  Thread1 9
  Thread1 10
  Thread2 1
  Thread2 2
  .
  .
  Thread2 9
  Thread2 10
  </code></pre>
  
  <p>what I want is </p>
  
  <pre><code>Thread1 1
  Thread1 2
  .
  .
  Thread1 9
  Thread1 10
  Thread2 11
  Thread2 12
  .
  .
  Thread2 19
  Thread2 20
  </code></pre>
  
  <p>What I have to do to achieve this?</p>