title: With Clause for Multiprocessing in Python
body: <p>In python 3, you can now open a file safely using the <code>with</code> clause like this:</p>
  
  <pre><code>with open("stuff.txt") as f:
      data = f.read()
  </code></pre>
  
  <p>Using this method, I don't need to worry about closing the connection</p>
  
  <p>I was wondering if I could do the same for the multiprocessing. For example, my current code looks like: </p>
  
  <pre><code>pool = multiprocessing.Pool(processes=multiprocessing.cpu_count())
  pool.starmap(function,list)
  pool.close()
  pool.join()
  </code></pre>
  
  <p>Is there any way I could use a with clause to simplify this?</p>