title: Can't kill child process using ProcessPoolExecutor?
body: <pre class="lang-py prettyprint-override"><code>from concurrent.futures import ProcessPoolExecutor
  import time
  
  def foo(num):
      time.sleep(0.5)
      print(num)
  
  
  if __name__ == "__main__":
      while True:
          with ProcessPoolExecutor(max_workers=8) as exe:
              exe.map(foo, range(1,4))
  </code></pre>
  
  <p>I'm tring to use module <code>ProcessPoolExecutor</code>. And after the main process started for a period of time, I want kill the process use linux kill command <code>kill -9 main_process_pid</code>. Then I found that only main process was killed, but child process still active.</p>
  
  <pre><code>
  user     41502 41004  5 16:16 pts/202  00:00:00 python demo.py
  user     42009 41502  0 16:16 pts/202  00:00:00 python demo.py
  user     42010 41502  0 16:16 pts/202  00:00:00 python demo.py
  user     42011 41502  0 16:16 pts/202  00:00:00 python demo.py
  user     42012 41502  0 16:16 pts/202  00:00:00 python demo.py
  user     42013 41502  0 16:16 pts/202  00:00:00 python demo.py
  user     42015 41502  0 16:16 pts/202  00:00:00 python demo.py
  user     42025 41502  0 16:16 pts/202  00:00:00 python demo.py
  user     42026 41502  0 16:16 pts/202  00:00:00 python demo.py
  
  
  </code></pre>
  
  <p>after I run  <code>kill -9 41502</code> , it turned to be </p>
  
  <pre><code>
  user     45109     1  0 16:17 pts/202  00:00:00 python demo.py
  user     45110     1  0 16:17 pts/202  00:00:00 python demo.py
  user     45111     1  0 16:17 pts/202  00:00:00 python demo.py
  user     45112     1  0 16:17 pts/202  00:00:00 python demo.py
  user     45113     1  0 16:17 pts/202  00:00:00 python demo.py
  user     45114     1  0 16:17 pts/202  00:00:00 python demo.py
  user     45115     1  0 16:17 pts/202  00:00:00 python demo.py
  user     45116     1  0 16:17 pts/202  00:00:00 python demo.py
  
  </code></pre>
  
  <p>What should I do to kill all child process while closing the main process?</p>