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

Discussion in 'Python' started by ichi, Jul 7, 2011.

  1. ichi

    ichi Guest

    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)...
     
    ichi, Jul 7, 2011
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tjerk Wolterink
    Replies:
    3
    Views:
    703
    Marrow
    Oct 22, 2004
  2. padma
    Replies:
    0
    Views:
    585
    padma
    Oct 3, 2007
  3. Andre-John Mas

    Copying without namespace?

    Andre-John Mas, Feb 29, 2008, in forum: XML
    Replies:
    11
    Views:
    1,057
    Joseph Kesselman
    Mar 10, 2008
  4. Terry
    Replies:
    2
    Views:
    623
    Terry
    Sep 1, 2009
  5. Sebastien Binet
    Replies:
    4
    Views:
    1,262
    Sebastien Binet
    Dec 16, 2009
  6. Metalone
    Replies:
    0
    Views:
    555
    Metalone
    Jan 6, 2010
  7. Veloz
    Replies:
    1
    Views:
    389
  8. Kevin Newman

    Javascript Namespace manager

    Kevin Newman, Oct 5, 2005, in forum: Javascript
    Replies:
    6
    Views:
    224
    Richard Cornford
    Oct 13, 2005
Loading...