Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import multiprocessing as mp
- def f(huge_amount):
- count = 0
- for i in range(huge_amount):
- if i % 2:
- count += 1
- else:
- count -= 1
- if __name__ == '__main__':
- huge_amount = 100000000000
- cpus = mp.cpu_count()
- list_amount = [huge_amount] * cpus
- with mp.Pool(cpus) as p:
- p.map(f, list_amount)
Add Comment
Please, Sign In to add comment