import threading import multiprocessing import time def processWorker(queue): for i in range(2000): queue.put(i) class WorkerThread(threading.Thread): def run(self): q = multiprocessing.Queue() p = multiprocessing.Process(target=processWorker, args=(q,)) p.start() while p.is_alive(): self.data = q.get() if __name__ == '__main__': max_count = 20 threads = [] for i in range(max_count): w = WorkerThread() w.start() threads.append(w) all_done = False while not all_done: all_done = True for t in threads: if t.is_alive(): all_done = False else: print("{}.data == {}".format(t.name, t.data)) #time.sleep(1.0) # adding this sleep reduces chances of thread never halting, but t.data is still wrong