Re: reloading code and multiprocessing

Discussion in 'Python' started by Chris Angelico, Jul 20, 2012.

  1. On Thu, Jul 19, 2012 at 8:15 PM, andrea crotti
    <> wrote:
    > We need to be able to reload code on a live system. This live system
    > has a daemon process always running but it runs many subprocesses with
    > multiprocessing, and the subprocesses might have a short life...
    > ...
    > As long as I import the code in the function and make sure to remove the
    > "pyc" files everything seems to work..
    > Are there any possible problems which I'm not seeing in this approach or
    > it's safe?


    Python never promises reloading reliability, but from my understanding
    of what you've done here, it's probably safe. However, you may find
    that you're using the wrong language for the job; it depends on how
    expensive it is to spin off all those processes and ship their work to
    them. But if that's not an issue, I'd say you have something safe
    there. (Caveat: I've given this only a fairly cursory examination, and
    I'm not an expert. Others may have more to say. I just didn't want the
    resident Markov chainer to be the only one to respond!!)

    ChrisA
    Chris Angelico, Jul 20, 2012
    #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. andrea crotti

    reloading code and multiprocessing

    andrea crotti, Jul 19, 2012, in forum: Python
    Replies:
    2
    Views:
    169
    88888 Dihedral
    Jul 19, 2012
  2. andrea crotti

    Re: reloading code and multiprocessing

    andrea crotti, Jul 23, 2012, in forum: Python
    Replies:
    0
    Views:
    141
    andrea crotti
    Jul 23, 2012
  3. Chris Angelico

    Re: reloading code and multiprocessing

    Chris Angelico, Jul 23, 2012, in forum: Python
    Replies:
    0
    Views:
    130
    Chris Angelico
    Jul 23, 2012
  4. andrea crotti

    Re: reloading code and multiprocessing

    andrea crotti, Jul 25, 2012, in forum: Python
    Replies:
    0
    Views:
    183
    andrea crotti
    Jul 25, 2012
  5. andrea crotti

    Re: reloading code and multiprocessing

    andrea crotti, Jul 27, 2012, in forum: Python
    Replies:
    0
    Views:
    153
    andrea crotti
    Jul 27, 2012
Loading...

Share This Page