Re: Multiprocessing zombie processes

Discussion in 'Python' started by Navkirat Singh, Jul 25, 2010.

  1. OK I wanted zombie processes and have been able to regenerate them with multiprocessing. Now lets see how I can handle them.
    Nav

    On 25-Jul-2010, at 4:37 AM, Navkirat Singh wrote:

    > Hi,
    >
    > I have been meddling around with forking and multiprocessing. Now both of them spawn new processes from parent (atleast from what I have understood). I have been able to reproduce a zombie state in a fork with:
    >
    > import os,time
    >
    > print('before fork',os.getpid())
    >
    > pid = os.fork()
    >
    > if pid:
    > print('child: ',pid)
    > time.sleep(120)
    >
    > Now doing a ps ax | grep <pid> I can find a zombie child process, but I am not being able to reproduce the same with multiprocessing. Am I missing something? Or multiprocessing does not have the zombie problem?
    >
    > Regards,
    > Nav
     
    Navkirat Singh, Jul 25, 2010
    #1
    1. Advertising

  2. On Jul 25, 1:11 am, Navkirat Singh <> wrote:
    > OK I wanted zombie processes and have been able to regenerate them with multiprocessing. Now lets see how I can handle them.


    The multiprocessing docs say:

    """
    Joining zombie processes

    On Unix when a process finishes but has not been joined it becomes a
    zombie. There should never be very many because each time a new
    process starts (or active_children() is called) all completed
    processes which have not yet been joined will be joined. Also calling
    a finished process’s Process.is_alive() will join the process. Even so
    it is probably good practice to explicitly join all the processes that
    you start.
    """
     
    Michele Simionato, Jul 26, 2010
    #2
    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. Brian
    Replies:
    1
    Views:
    320
    Keith Dart
    Dec 22, 2004
  2. Replies:
    0
    Views:
    515
  3. Navkirat Singh

    Multiprocessing zombie processes

    Navkirat Singh, Jul 25, 2010, in forum: Python
    Replies:
    0
    Views:
    273
    Navkirat Singh
    Jul 25, 2010
  4. Chris Rebert

    Re: Multiprocessing zombie processes

    Chris Rebert, Jul 25, 2010, in forum: Python
    Replies:
    2
    Views:
    376
    Chris Rebert
    Jul 26, 2010
  5. serge.john.swilting

    plouk zombie plouk zombie

    serge.john.swilting, Aug 19, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    201
    hudson
    Aug 20, 2003
Loading...

Share This Page