title: What exactly is Python multiprocessing Module's .join() Method Doing?
body: <p>Learning about Python <a href="https://docs.python.org/2/library/multiprocessing.html" rel="noreferrer">Multiprocessing</a> (from a <a href="http://pymotw.com/2/multiprocessing/basics.html" rel="noreferrer">PMOTW article</a>) and would love some clarification on what exactly the <code>join()</code> method is doing.</p>
  
  <p>In an <a href="http://toastdriven.com/blog/2008/nov/11/brief-introduction-multiprocessing/" rel="noreferrer">old tutorial from 2008</a> it states that without the <code>p.join()</code> call in the code below, "the child process will sit idle and not terminate, becoming a zombie you must manually kill".</p>
  
  <pre><code>from multiprocessing import Process
  
  def say_hello(name='world'):
      print "Hello, %s" % name
  
  p = Process(target=say_hello)
  p.start()
  p.join()
  </code></pre>
  
  <p>I added a printout of the <code>PID</code> as well as a <code>time.sleep</code> to test and as far as I can tell, the process terminates on its own:</p>
  
  <pre><code>from multiprocessing import Process
  import sys
  import time
  
  def say_hello(name='world'):
      print "Hello, %s" % name
      print 'Starting:', p.name, p.pid
      sys.stdout.flush()
      print 'Exiting :', p.name, p.pid
      sys.stdout.flush()
      time.sleep(20)
  
  p = Process(target=say_hello)
  p.start()
  # no p.join()
  </code></pre>
  
  <p>within 20 seconds:</p>
  
  <pre><code>936 ttys000    0:00.05 /Library/Frameworks/Python.framework/Versions/2.7/Reso
  938 ttys000    0:00.00 /Library/Frameworks/Python.framework/Versions/2.7/Reso
  947 ttys001    0:00.13 -bash
  </code></pre>
  
  <p>after 20 seconds:</p>
  
  <pre><code>947 ttys001    0:00.13 -bash
  </code></pre>
  
  <p>Behavior is the same with <code>p.join()</code> added back at end of the file. Python Module of the Week offers a <a href="http://pymotw.com/2/multiprocessing/basics.html" rel="noreferrer">very readable explanation of the module</a>; "To wait until a process has completed its work and exited, use the join() method.", but it seems like at least OS X was doing that anyway. </p>
  
  <p>Am also wondering about the name of the method. Is the <code>.join()</code> method concatenating anything here? Is it concatenating a process with it's end? Or does it just share a name with Python's native <code>.join()</code> method?</p>