Windows python multiprocessing - need to pass shared variable to worker -


according this: python multiprocess diff between windows , linux

unlike unix, global variables need explicitly propogated. hence, hoping send multiprocessing queue in updated, seems give pickling errors:

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())     in range(0,mulitprocess_global):         pool.apply_async(worker, args=(str(i),queue_global)) 

on windows, passing in queue_global variable causes pickling error. there no other way workers access shared resource if not. globals don't work in windows


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -