Questions tagged «missing-features»

8
线程池类似于多处理池?
是否有用于工作线程的Pool类,类似于多处理模块的Pool类? 我喜欢例如并行化地图功能的简单方法 def long_running_func(p): c_func_no_gil(p) p = multiprocessing.Pool(4) xs = p.map(long_running_func, range(100)) 但是,我希望这样做而不会产生新流程的开销。 我知道GIL。但是,在我的用例中,该函数将是IO绑定的C函数,python包装程序将在实际函数调用之前为其释放GIL。 我必须编写自己的线程池吗?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.