Results 1 to 6 of 6

Thread: what does "child process" mean?

  1. #1
    Join Date
    May 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what does "child process" mean?

    Quote Originally Posted by sanjac View Post
    will they be listed as children of the spawning process in the operating system's task manager?
    Yes.
    will they terminate when the spawning process terminates?
    Yes.
    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.
    is there any other significance to which process spawned which?
    I don't understand what you mean.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    sanjac (23rd May 2010)

  4. #3
    Join Date
    May 2010
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: what does "child process" mean?

    Quote Originally Posted by wysota View Post
    will they terminate when the spawning process terminates?
    Yes.
    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?)

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what does "child process" mean?

    Quote Originally Posted by sanjac View Post
    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.

    (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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #5
    Join Date
    Feb 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: what does "child process" mean?

    Quote Originally Posted by wysota View Post
    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

  7. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default 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

Similar Threads

  1. Replies: 1
    Last Post: 7th April 2010, 21:46
  2. Replies: 3
    Last Post: 15th February 2010, 17:27
  3. Replies: 3
    Last Post: 8th July 2008, 19:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.