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. Advertising

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. padma
    Replies:
    0
    Views:
    378
    padma
    Oct 3, 2007
  2. Terry
    Replies:
    2
    Views:
    532
    Terry
    Sep 1, 2009
  3. Sebastien Binet
    Replies:
    4
    Views:
    920
    Sebastien Binet
    Dec 16, 2009
  4. Metalone
    Replies:
    0
    Views:
    367
    Metalone
    Jan 6, 2010
  5. Veloz
    Replies:
    1
    Views:
    314
Loading...

Share This Page