Python multiprocessing Queue failure -
Text after "div class =" itemprop = "text">
I create 100 child processes
proc_list = [process (target = simulator, arg = For proc in xrange (result_queue,)) for i (100)] and start them
proc_list: proc.start () < / Code> Keeps each process in result_queue (example of multiprocessing.Queue) doing some processing.
DEF emulation (alg_instance, image_ids, gamma, result, 10000 tuples after simulation, sim_semaphore): (rs, qs, t_us) = alg_instance.simulate_multiple (image_ids, gamma, simulation) all_tuples = Zip (rs, qs, t_us) for results in all_tuples: results.put (result) sim_semaphore.release () I should be getting 1000000 tuples in the queue, but different runs After I get these (sample) size (?): 14912 19563 12952 13524 7487 18350 15986 11928 14281 14282 7317 Any suggestions?
My solution of multiproduction issues is almost always used to access manager objects while revealing the interface equals The implicit implementation is very simple and there are few bugs.
= Manager from Multi Import Manager Manager () result_queue = manager.Queue () Try it and see if it does not solve your issues.
Comments
Post a Comment