pathm=Manager().Queue(len(pathlist)) for d in pathlist: pathm.put(d) p=Pool(cp.threads) results=[] for i in range(cp.threads): temp=p.apply_async(ProcessWorker,args=(i,pathm,cp)) results.append(temp) print 'Waiting for all subprocesses done...' p.close() p.join() print 'All subprocesses finish Processing.' results=[r.get() for r in results]
以上就是基于python的多进程共享变量正确打开方式的详细内容,更多请关注Gxl网其它相关文章!
查看更多关于基于python的多进程共享变量正确打开方式的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did84005