On Thu, Dec 17, 2009 at 23:48 -0800, blumenkraft wrote:
> I want to share dictionary between two distinct processes.
> Something like this:
> 
> first.py
> import magic_share_module
> def create_dictionary():
>     return {"a": 1}
> 
> magic_share_module.share("shared_dictionary",
> creator.create_dictionary)
> while True:
>      pass

Have a look at multiprocessing.Manager() it provides (among other
things) proxies for dictionaries that can be used in different threads.
These are even accessible on different hosts if configures correctly.
-- 
  .''`.     Wolodja Wentland    <wentl...@cl.uni-heidelberg.de> 
 : :'  :    
 `. `'`     4096R/CAF14EFC 
   `-       081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC

Attachment: signature.asc
Description: Digital signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to