Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from multiprocessing import Process
- import random
- import time
- def some_function(first, last):
- time.sleep(random.randint(1, 3))
- print(first,last)
- processes = []
- for m in range(1,16):
- n = m + 1
- p = Process(target=some_function, args=(m, n))
- p.start()
- processes.append(p)
- print("not joined")
- for p in processes:
- p.join()
- print("adesso si")
Add Comment
Please, Sign In to add comment