title: multiprocessing.Process.is_alive() returns True although process has finished, why?
body: <p>I use <code>multiprocess.Process</code> to create a child process and then call <code>os.wait4</code> until child exists. When the actual child process finishes, <code>multiprocess.Process.is_alive()</code> still returns <code>True</code>. That's contradicting. Why?</p>
  
  <p>Code:</p>
  
  <pre class="lang-py prettyprint-override"><code>from multiprocessing import Process
  import os, sys
  
  proc = Process(target=os.system, args= ("sleep 2", ))
  proc.start()
  
  print "is_alive()", proc.is_alive()
  ret = os.wait4(proc.pid, 0)
  procPid, procStatus, procRes = ret
  print "wait4 = ", ret
  
  ## Puzzled!
  print "----Puzzled below----"
  print "is_alive()", proc.is_alive()
  if os.WIFEXITED(procStatus):
      print "exit with status", os.WEXITSTATUS(procStatus)
  print "is_alive()", proc.is_alive()
  sys.exit(1)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>is_alive() True
  wait4 =  (11137, 0, resource.struct_rusage(ru_utime=0.0028959999999999997, ru_stime=0.003189, ru_maxrss=1363968, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=818, ru_majflt=0, ru_nswap=0, ru_inblock=0, ru_oublock=0, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=1, ru_nivcsw=9))
  ----Puzzled below----
  is_alive() True
  exit with status 0
  is_alive() True
  </code></pre>
  
  <p>My question is about the last three output lines. Why <code>is_alive()</code> return <code>True</code> when the actual process is finished. How can that happen?</p>