remote multiprocessing, shared object

Kushal Kumaran kushal.kumaran+python at
Thu Apr 8 08:20:51 CEST 2010

On Thu, Apr 8, 2010 at 11:30 AM, Norm Matloff <matloff at> wrote:
> Thanks very much, Kushal.
> But it seems to me that it doesn't quite work.  After your first client
> below creates l and calls append() on it, it would seem that one could
> not then assign to it, e.g. do
>   l[1] = 8
> What I'd like is to write remote multiprocessing code just like threads
> code (or for that matter, just like shared-memory multiprocessing code),
> i.e. reading and writing shared globals.  Is this even possible?

Try this server:
from multiprocessing.managers import BaseManager, ListProxy
shared_list = []
class ListManager(BaseManager): pass
ListManager.register('get_list', callable=lambda:shared_list,
m = ListManager(address=('', 50000), authkey='abracadabra')
s = m.get_server()

Just changed the proxy type appropriately.  See the file
in the multiprocessing source for details.

> <snipped>


More information about the Python-list mailing list