- for i in range(0, int(num)):
- result.append(pool.apply_async(func_run, (con_dic, )))
- pool.close()
- pool.join()
- for res in result:
- out_num = out_num + float(res.get())
+
+ for i in xrange(0, num):
+ temp_thread = threading.Thread(target=func_run, args=(str(i),))
+ threadings.append(temp_thread)
+ temp_thread.start()
+ for one_thread in threadings:
+ one_thread.join()
+ while not q.empty():
+ result.append(q.get())
+ for item in result:
+ out_num = out_num + float(item[0])