Thread: question about wait(NULL) in C

  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
    Registered User
    Join Date
    Sep 2007
    Posts
    1,012
    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, 12: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