Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import threading
- from queue import Queue
- def myfunc():
- while True:
- num = queue.get()
- print(num / 10)
- queue.task_done()
- def myfunc2():
- while True:
- num = queue.get()
- print(num * 10)
- queue.task_done()
- queue = Queue()
- for t in range(3):
- threading.Thread(target=myfunc, daemon=True).start()
- mylist = []
- for x in range(10):
- for i in range(10):
- for i in range (10):
- mylist.append(i)
- for i in mylist:
- queue.put(i)
- queue.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement