Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import threading
- produkt = 1
- lock = threading.Lock()
- def mnozenje(x,y):
- global produkt
- lock.acquire()
- for i in range(x,y):
- produkt*=i
- lock.release()
- t1=threading.Thread(target=mnozenje, args=(1,750))
- t2=threading.Thread(target=mnozenje, args=(751,1500))
- t1.start()
- t2.start()
- t1.join()
- t2.join()
- print (produkt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement