Re: Creating and killing processes
From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 03/18/04
- Next message: somez72: "to send my message to syslogd?"
- Previous message: Jens: "Creating and killing processes"
- In reply to: Jens: "Creating and killing processes"
- Next in thread: Jens: "Re: Creating and killing processes"
- Reply: Jens: "Re: Creating and killing processes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Mar 2004 13:15:37 +0100
Jens wrote:
>
> Question 1: Isn't it possible to launch an application from another
> application and then get completely detached just like Windows? This would
> probably resolve my problems.
fork twice let the intermediate process terminate
and have the parent wait at once for the
intermediate process.
>
> Question 2: Any clue as to why it get stuck and doesn't release the PID
> completely?
It is a zombie. A dead process cannot remove itself
from the task list, somebody else have to do. On
Unix the parent is responsible to do that, it is
done with one of the wait system calls that can do
a couple of things:
1) Wait for a child to terminate.
2) Collect the exist status of the child.
3) Remove the child from the task list.
The execve call doesn't change the parent/child
relationship. It only replaces the process image
of one of the processes with a new executable.
http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html#zombie
-- Kasper Dupont -- der bruger for meget tid paa usenet. For sending spam use mailto:aaarep@daimi.au.dk /* Would you like fries with that? */
- Next message: somez72: "to send my message to syslogd?"
- Previous message: Jens: "Creating and killing processes"
- In reply to: Jens: "Creating and killing processes"
- Next in thread: Jens: "Re: Creating and killing processes"
- Reply: Jens: "Re: Creating and killing processes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|