threads and concurrency if _name_ =' _main_ ' multiprocessing manager( dict(create shared dict evt event(create shared event launch process that watches the dictionary multiprocessing process(target=watch,args=( ,evt) daemon=true start(update the dictionary and notify the watcher ['foo' evt set(time sleep( update the dictionary and notify the watcher ['bar' evt set(time sleep( terminate the process and manager terminate( shutdown(if you run this examplethe watch(function prints out the value of every time the passed event gets set in the main programa shared dictionary and event are created and manipulated in the main process when you run thisyou will see the child process printing data if you want to have shared objects of other types such as instances of user-defined classesyou have to create your custom manager object to do thisyou create class that inherits from basemanagerwhich is defined in the multiprocessing managers submodule managers basemanager([address [authkey]]base class used to create custom manager servers for user-defined objects address is an optional tuple (hostnameportthat specifies network address for the server if omittedthe operating system will simply assign an address corresponding to some free port number authkey is string that is used to authenticate clients connecting to the server if omittedthe value of current_process(authkey is used if mgrclass is class that inherits from basemanagerthe following class method is used to create methods for returning proxies to shared objects mgrclass register(typeid [callable [proxytype [exposed [method_to_typeid [create_method]]]]]registers new data type with the manager class typeid is string that is used to name particular kind of shared object this string should be valid python identifier callable is callable object that creates or returns the instance to be shared proxytype is class that provides the implementation of the proxy objects to be used in clients normallythese classes are generated by default so this is normally set to none exposed is sequence of method names on the shared object that will be exposed to proxy objects if omittedthe value of proxytype _exposed_ is used and if that is undefinedthen all public methods (all callable methods that don' start with an underscore (_are usedmethod_to_typeid is mapping from method names to type ids that is used to specify which methods should return their results using proxy objects if lib fl ff