GeekInterview.com
Series: Subject: Topic:
Question: 10 of 267

Fork () function

How does a process generates Child process using Fork() function.The concept of it. For example: A process execute the code fork() fork() fork() Total Number of "child" process created is/are ?
Asked by: sharad kumar sharma | Member Since May-2012 | Asked on: May 12th, 2012

View all questions by sharad kumar sharma

Showing Answers 1 - 2 of 2 Answers
Barun

Answered On : May 25th, 2012

The number of Child Processes Created would be
2^(No. of Fork() functions called)

So in the example given it would be
2^3 = 8 Child Processes

Yes  1 User has rated as useful.
  
Login to rate this answer.
Amit G

Answered On : May 29th, 2012

2^3 = 8 , agreed -> but 1 will be the parent process , so the child processes is 7

Yes  1 User has rated as useful.
  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.