Skip to content

Instantly share code, notes, and snippets.

@mperlet
Created April 12, 2017 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mperlet/213551d5853efdd9d0c2fd3006313b88 to your computer and use it in GitHub Desktop.
Save mperlet/213551d5853efdd9d0c2fd3006313b88 to your computer and use it in GitHub Desktop.
parallel python map function
def pmap(func, iter, pool_size=4):
""" Like pythons map() function but parallel """
from multiprocessing.dummy import Pool
return Pool(pool_size).map(func, iter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment