jjzjj

BrokenProcessPool

全部标签

windows - `ProcessPoolExecutor` 在 Ubuntu 上工作,但在 Windows 10 上运行带有 Python 3.5.3 的 Jupyter 5.0.0 笔记本时失败并显示 `BrokenProcessPool`

我在Windows10上使用Python3.5.3运行Jupyter5.0.0notebook。以下示例代码无法运行:fromconcurrent.futuresimportas_completed,ProcessPoolExecutorimporttimeimportnumpyasnpdefdo_work(idx1,idx2):time.sleep(0.2)returnnp.mean([idx1,idx2])withProcessPoolExecutor(max_workers=4)asexecutor:futures=set()foridxinrange(32):future=wi

python - 在 python 的 concurrent.futures 中查找 BrokenProcessPool 的原因

一言以蔽之当使用concurrent.futures并行化我的代码时,我得到了一个BrokenProcessPool异常。不会显示更多错误。我想找到错误的原因并询问如何做到这一点的想法。完整问题我正在使用concurrent.futures并行化一些代码。withProcessPoolExecutor()aspool:mapObj=pool.map(myMethod,args)我以(且仅以)以下异常结束:concurrent.futures.process.BrokenProcessPool:Achildprocessterminatedabruptly,theprocesspooli

python - 所有示例 concurrent.futures 代码都失败并显示 "BrokenProcessPool"

在创建我需要的实际应用程序之前,我试图对此有一个基本的了解。我最近从2.7转移到了3.3。thiscodefromthepythondocs的直接复制粘贴失败,来自here的一个稍微简单的例子也是如此.这是我的代码,源自第二个示例:importconcurrent.futuresnums=[1,2,3,4,5,6,7,8,9,10]deff(x):returnx*x#Makesurethemapandfunctionareworkingprint([valforvalinmap(f,nums)])#Testtomakesureconcurrentmapisworkingwithconc