Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python: multiprocessing Event

What is difference between multiprocessing.Event and multiprocessing.managers.SyncManager.Event. When do I use each? Why two different objects exist?

Same question for other similar objects existing in multiprocessing directly and also in Manager (Lock, etc.)

like image 989
zaharpopov Avatar asked Dec 24 '11 18:12

zaharpopov


1 Answers

Unfortunately, the only given answer is not very correct and others wasn't given.

I looked it up my own, and found that multiprocessing.Event can be used to synch between processes, it's completely alright.

Event and other objects from multiprocessing.Manager exist to be able to synchronize things between processes that runs on different machines via sockets under the hood. They also can be used synchronize on single machine, but less efficient for this than just using synch objects from multiprocessing.synchronize (like Event and Lock and others)

like image 65
zaharpopov Avatar answered Sep 20 '22 11:09

zaharpopov