what does "child process" mean?
The QProcess documentation unfortunately fails to give any explanation about how a process spawned with this class behaves with respect to the spawning process, or how the two are related altogether.
Further down the page, some function descriptions refer to the spawned processes as "child processes", but the main description at the top of the page doesn't even contain this phrase.
So in what way are they "child processes"?
Specifically,
- will they be listed as children of the spawning process in the operating system's task manager?
- will they terminate when the spawning process terminates?
- will they crash when the spawning process crashes?
- is there any other significance to which process spawned which?
Re: what does "child process" mean?
Quote:
Originally Posted by
sanjac
will they be listed as children of the spawning process in the operating system's task manager?
Yes.
Quote:
will they terminate when the spawning process terminates?
Yes.
Quote:
will they crash when the spawning process crashes?
They will be terminated. At least if that's the operating system's policy but it should be that way.
Quote:
is there any other significance to which process spawned which?
I don't understand what you mean.
Re: what does "child process" mean?
Quote:
Originally Posted by
wysota
Quote:
will they terminate when the spawning process terminates?
Yes.
Quote:
will they crash when the spawning process crashes?
They will be terminated. At least if that's the operating system's policy but it should be that way.
I see, thanks for you reply.
Is there no Qt-ish (elegant, cross-platform) way then to spawn a process which the spawning process can watch (monitor status, respawn if crashed) and communicate with (using stdio preferably), but which stays alive even after the spawning process crashes? That would be the ideal behavior for my app...
(Btw: is there an official place to let the the Qt team know that the documentation could really use some improvement regarding all of this?)
Re: what does "child process" mean?
Quote:
Originally Posted by
sanjac
Is there no Qt-ish (elegant, cross-platform) way then to spawn a process which the spawning process can watch (monitor status, respawn if crashed) and communicate with (using stdio preferably), but which stays alive even after the spawning process crashes? That would be the ideal behavior for my app...
You can use QProcess::startDetached() to launch the process and communicate with it with a named pipe. You can probably exclude the process from the process group once it's launched using native API.
Quote:
(Btw: is there an official place to let the the Qt team know that the documentation could really use some improvement regarding all of this?)
Qt has nothing to do with this. This is all OS policy that drives this behaviour. I think this is called "process group", at least in Unix world.
Re: what does "child process" mean?
Quote:
Originally Posted by
wysota
Yes.
Yes.
They will be terminated. At least if that's the operating system's policy but it should be that way.
I don't understand what you mean.
I have the opposite problem.. where my child processes do NOT terminate/crash/end when the parent crashes, and I want them to. Is there something I can do to implement this? (My Qt program is running in windows.)
Thanks,
Tenchi
Re: what does "child process" mean?
Start your own thread (rather than resurrecting a long dead one) with a small example program that demonstrates the problem