multithreading - Python basic threading issue -
trying simple threading operation queues. there's no run error, function isn't executing.
heres code:
data = ['1', '2', '3'] def do_stuff(arg1): print arg1 def start(num_threads): q = queue.queue() item in data: q.put(item) in xrange(num_threads): t = threading.thread(target=run, args=(do_stuff, q)) t.start() def run(func, queue): while queue: try: func(queue.get(false)) except queue.empty: break start(2)
Comments
Post a Comment