title: Deadlock with multiprocessing module
body: <p>I have a function that without multiprocessing loops over an array with 3-tuples and does some calculation. This array can be really long (>1million entries) so I thought using several processes could help speed things up.</p>
  
  <p>I start with a list of points (<code>random_points</code>) with which I create a permutation of all possible triples (<code>combList</code>). This <code>combList</code> then is passed to my function.
  The basic code I have works but only when the <code>random_points</code> list has 18 entries or less.</p>
  
  <pre><code>from scipy import stats
  import itertools
  import multiprocessing as mp
  
  def calc3PointsList( points,output ):
    xy = []
    r = []
    for point in points:
      // do stuff with points and append results to xy and r
    output.put( (xy, r) )
  
  
  output = mp.Queue()
  
  random_points = [ (np.array((stats.uniform(-0.5,1).rvs(),stats.uniform(-0.5,1).rvs()))) for _ in range(18)]
  combList = list(itertools.combinations(random_points, 3))
  N = 6
  processes = [mp.Process(target=calc3PointsList, args=(combList[(i-1)*len(combList)/(N-1):i*len(combList)/(N-1)],output)) for i in range(1,N)]
  
  for p in processes:
    p.start()
  for p in processes:
    p.join()
  results = [output.get() for p in processes]
  </code></pre>
  
  <p>As soon as the length of the random_points list is longer than 18 the program seems to go into a deadlock. With 18 and lower it just finishes fine. Am I using this whole multiprocessing module the wrong way?</p>