title: change object value in threads using python
body: <p>I am very new to Python, thus am possibly asking a simple question.</p>
  
  <p>I am wrting a multiprocess code with Python:</p>
  
  <pre><code>from multiprocessing import Process
  from multiprocessing import Queue
  
  class myClass(object):
  
      def __init__(self):
          self.__i = 0
          self.__name = 'rob'
          return
  
      def target_func(self, name, q):
          self.__name = name
          print 'Hello', self.__name
          self.__i += 1
          print self.__i
          q.put([self.__i, self.__name])
          return
  
      def name(self):
          return self.__name
  
      def i(self):
          return self.__i
  
  
  if __name__ == '__main__':
      mc = myClass()
  
      q = Queue()
  
      p = Process(target = mc.target_func, args = ('bob', q,))
      p.start()
      ret = q.get()
      p.join()
  
      p2 = Process(target = mc.target_func, args = ('tom', q,))
      p2.start()
      ret = q.get()
      p2.join()
  </code></pre>
  
  <p>I expect the print out should be </p>
  
  <pre><code>Hello bob
  1
  Hello tom
  2
  </code></pre>
  
  <p>But actually, the print out is </p>
  
  <pre><code>Hello bob
  1
  Hello tom
  1    &lt;------------------ Why it's not 2?
  </code></pre>
  
  <p>May I know what am I wrong? </p>
  
  <p>Many thanks.</p>