When to lock data items returned by multiprocessing.Manager?

Veloz michaelveloz at gmail.com
Wed Mar 3 17:39:18 CET 2010

So I'm using a multiprocessing.Manager instance in my main app and
asking it to create a dictionary, which I am providing to instances of
the application that I'm forking off with Process.

The Processes and main app will be reading/writing to the dictionary.

It's not clear to me what I have to "lock" and what I don't have to
lock. Any ideas?

I'm thinking that what Manager brings to the table is the ability to
share the dictionary but it may not provide anything to control
concurrent access to it, and thus I should lock all operations I
perform on it.. But I don't know this for a fact. Any input is
welcomed on this!!


More information about the Python-list mailing list