question about wait(NULL) in C

This is a discussion on question about wait(NULL) in C within the C Programming forums, part of the General Programming Boards category; if you use wait(NULL) in C, its supposed to wait until all child process's are completes first, but if u ...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    29

    question about wait(NULL) in C

    if you use wait(NULL) in C, its supposed to wait until all child process's are completes first, but if u have a child that has another child does it wait until all these are exited? What if the first parent process has 2 childs, then it has to wait for these to finish?

  2. #2
    cas
    cas is offline
    Registered User
    Join Date
    Sep 2007
    Posts
    993
    if you use wait(NULL) in C, its supposed to wait until all child process's are completes first
    No, it waits until a child (any child) of the process terminates, not all of them.
    but if u have a child that has another child does it wait until all these are exited?
    wait() only worries about the children of the process. It doesn't care about its grandchildren.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 12-08-2009, 03:04 PM
  2. Replies: 5
    Last Post: 06-18-2009, 01:04 PM
  3. integer null question
    By transgalactic2 in forum C Programming
    Replies: 6
    Last Post: 01-06-2009, 01:22 PM
  4. wait() question
    By kocika73 in forum C Programming
    Replies: 2
    Last Post: 02-06-2006, 12:24 PM
  5. NULL question
    By peking1983 in forum C Programming
    Replies: 1
    Last Post: 02-03-2003, 12:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21