multiprocessing.Manager().Namespace() and data copying

ichi mrkwjc at gmail.com
Thu Jul 7 16:08:37 EDT 2011


Hi!
I'm trying to share data between processes using
multiprocessing.Manager and 
creating shared Namespace. I have the following code:


from multiprocessing import Manager
from scipy import rand

x = rand(5000, 5000)

m = Manager()
n = m.Namespace()
n.x = x  

It seems that at n.x = x data is serialized and copied. It seems it is
also 
serialized and copied at x = n.x. Is there a way to omit this to have
really 
shared objects with Namespace? I need read only objects (not
necessarily 
arrays)...



More information about the Python-list mailing list