Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import concurrent.futures
- def add(x):
- s = 0
- for e in x:
- s += e
- return s
- #with concurrent.futures.ProcessPoolExecutor() as e:
- with concurrent.futures.ThreadPoolExecutor() as e:
- print(tuple(e.map(add, [[1, 2, 3], [1, 2], [3, 4]])))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement