根据这个: Python Multiprocess diff between Windows and Linux
与UNIX不同,全局变量需要明确传播。因此,我希望发送一个多处理队列进行更新,但它似乎给出了酸洗错误:
global level_data_global, max_level_global, items_global, count_global, domain_global, items_global, count_global, max_level_global, mulitprocess_global, queue_global
# Threadpool
if mulitprocess_global:
pool = Pool(processes=mp.cpu_count())
for i in range(0,mulitprocess_global):
pool.apply_async(worker, args=(str(i),queue_global))
在Windows上,传入该queue_global变量会导致酸洗错误。如果没有,我的工作人员无法访问共享资源。全局不在Windows中工作