title: multiprocessing.Pool.map_async doesn't seem to... do anything at all?
body: <p>So, I'm working on an application that has to check ~50 GB of data against a list of hashes every time it starts up. Obviously this needs to be parallelized, and I don't want the application hanging on a "LOADING..." screen for a minute and a half.</p>
  
  <p>I'm using <code>multiprocessing.Pool</code>'s <code>map_async</code> to handle this; the main thread calls <code>map_async(checkfiles, path_hash_pairs, callback)</code> and provides a callback that tells it to throw up a warning if mismatches are found.</p>
  
  <p>Trouble is... nothing happens. Looking at the Python processes with my task manager shows they spawn and then immediately terminate without doing any work. They never print anything and certainly never finish and call the callback.</p>
  
  <p>This minified example also exhibits the same problem:</p>
  
  <pre><code>def printme(x):
      time.sleep(1)
      print(x)
      return x**2
  
  if __name__ == "__main__":
      l = list(range(0,512))
  
      def print_result(res):
          print(res)
  
      with multiprocessing.Pool() as p:
          p.map_async(printme, l, callback=print_result)
      p.join()
      time.sleep(10)
  </code></pre>
  
  <p>Run it, and... nothing happens. Swapping <code>map_async</code> for <code>map</code> works exactly as expected.</p>
  
  <p>Am I just making a stupid mistake or what?</p>