...
 
Commits (2)
#!/usr/bin/env python
#
# nasledujici funguje v standardnim pythonu ale treba ne v defaultnim 2.7.5 na CentOSu
import multiprocessing
print multiprocessing.__version__
def f(x): return x*x
pool = multiprocessing.Pool(processes=4)
print pool.map(f, range(10))
pool.close()
pool.join()
#!/usr/bin/env python
#
# nasledujici funguje pouze pod multiprocess s podporou dill
import multiprocess
pool = multiprocess.Pool(processes=4)
print (pool.map(lambda x: (lambda y:y**2)(x) + x, xrange(10)))