大佬们,可以帮忙解答一下吗?
python处理多进程,当创建多余60个进行,报错ValueError: need at most 63 handles, got a sequence of length 63
主要代码块如下:
def main(self):
print(f'Parent process {os.getpid()}')
p = Pool(60) # 用Pool进程池,创建进程,超过60会报错ValueError: need at most 63 handles, got a sequence of length 63
result = []
rurntime = time.time() # 用于记录执行时长
i = 0 # 用于记录执行的任务数
for i in range(100):
result.append(p.apply_async(self.pool_rum, args=(i,)))
p.close()
p.join()
for res in result:
print(res.get())
print('All subprocesses done')