while True:
    item = queue.get(True)
print(os.getpid(), 'got', item)
time.sleep(1)
the_pool = multiprocessing.Pool(3, worker_main, (the_queue,))
for i in range(5):
    the_queue.put('hello')
the_queue.put('world')
time.sleep(10)
Filling a queue and managing multiprocessing in python