我目前正在尝试创建一个将在进程之间共享的队列,但是我收到错误,如标题[Errno 11]资源暂时不可用。但是我不确定发生了什么,我试图对它进行重试,看它是否能解决问题,但事实并非如此。
OutputQ = None
WorkersPerCPU = 1
pool_size = mp.cpu_count() * WorkersPerCPU
pool = mp.Pool(processes=pool_size)
manager = mp.Manager()
while not OutputQ:
try:
OutputQ = manager.Queue()
except:
pass
finally:
print "retrying..."
time.sleep(2)
pool.apply_async(KeepAlive, (a, b, OutputQ))
尝试分配队列时会触发异常。