mirror of
https://github.com/autistic-symposium/web3-starter-py.git
synced 2025-05-17 22:20:22 -04:00
add concurrence examples
This commit is contained in:
parent
614452d462
commit
516c922e02
15 changed files with 64 additions and 248 deletions
|
@ -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]))
|
Loading…
Add table
Add a link
Reference in a new issue