add concurrence examples

This commit is contained in:
Mia von Steinkirch 2020-03-21 14:24:55 -07:00
parent 614452d462
commit 516c922e02
15 changed files with 64 additions and 248 deletions

View file

@ -2,9 +2,10 @@
from multiprocessing import Pool
def f(x):
return x*x
if __name__ == '__main__':
p = Pool(5)
print(p.map(f, [1, 2, 3]))
p = Pool(5)
print(p.map(f, [1, 2, 3]))