mirror of
https://code.it4i.cz/sccs/easyconfigs-it4i.git
synced 2025-04-08 07:52:11 +01:00
deleted: m/multiprocess/test.py
This commit is contained in:
parent
eae599e82e
commit
04dc045baf
@ -1,21 +0,0 @@
|
||||
#!/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)))
|
Loading…
x
Reference in New Issue
Block a user