在python中经常会到用多线程处理某个函数来缩短运行时间。 ... x+1 pool = Pool(processes=4) # 4个线程x = [1,2,3,4,5,6] results = pool.map(work, x) print results.
確定! 回上一頁