Skip to content

Instantly share code, notes, and snippets.

@goutomroy
Created July 21, 2019 20:00
Show Gist options
  • Save goutomroy/15f2d1191f7eb6ed2048f351fddfd30b to your computer and use it in GitHub Desktop.
Save goutomroy/15f2d1191f7eb6ed2048f351fddfd30b to your computer and use it in GitHub Desktop.
from multiprocessing import Pool
def f(x):
return x*x
if __name__ == '__main__':
p = Pool(5)
print(p.map(f, [1, 2, 3]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment