title: python multiprocessing process.join() waits forever
body: <p>I am new to Python multiprocessing and for the life of me I cant figure this one out. Basically I have a task that takes quite some time that I need to repeatedly do 100s of times. Each time I modify a common resource to the processes.
  So I want to launch 4 processes in batches wait for them to be done and then launch the next 4.
  Here is my main function</p>
  
  <pre><code>lock = Lock() #global defined at the start of my file
  myObj = MyObj()
  processes = []
  for num in range(1,100):
      if len(processes) &lt; 5:
          p = Process(target=myObj.longFunc, args =())
          p.start()
          processes.append(p)
      else:
          for proc in processes:
              proc.join()
          processes = []
  </code></pre>
  
  <p>Here is the MyObj.longFunc fonction:</p>
  
  <pre><code>def longFunc:
      lock.acquire()
      #Do stuff on common resourse which is a multiprocessing.Queue object
      lock.release()
      #Do more stuff
      print 'process should return'
      return 0
  </code></pre>
  
  <p>I get the following ouput:</p>
  
  <pre><code>process should return
  process should return
  process should return
  process should return
  process should return
  </code></pre>
  
  <p>And then the program just waits there 'forever'.
  Doesnt the output mean the processes are done running and the next batch of processes should be created? What am I missing.
  Thanks in advance! and sorry if its a stupid questions Im a newbie :)</p>