-
-
Save eka/9db2854283eb86cb0ba0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiprocessing | |
import sys | |
def foo(value): | |
print "sleeping for %s secs" % value | |
sleep(value) | |
values = range(10) | |
pool = multiprocessing.Pool(processes=int(sys.argv[1])) | |
pool.map_async(foo, values) | |
pool.close() | |
pool.join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment