Question: CSCI16638 Programming assignment 2 Spring 2018 We will be adding to the functionality of Program 1, we now want to have program! fork(.) multiple processes.

 CSCI16638 Programming assignment 2 Spring 2018 We will be adding to

CSCI16638 Programming assignment 2 Spring 2018 We will be adding to the functionality of Program 1, we now want to have program! fork(.) multiple processes. The parent and children will output messages every loop displaying the process id. 1.Only the parent process should fork processes. The input parameter will specify how many child processes the parent should fork. If no parameter is given the number of child processes should be 3 The processes should loop 5 times as shown below. 2. Make the parent process wait for both children to finish. Demonstrate this by making the run faster than the children (or make the children slower, or both) parent 3. A sample run is shown below. Notice how the parent runs faster than the children and how it waits for the children to finish. I don't care what the output messages are as long as the process ID i printed and whether it is the parent of child node. I am providing a c file to get you started alpha.fdu.edu> a.out 3 ld process 30477 with count 1 hild process 30401 with count 1 Patent process 29652 with count 1 Child process 28438 with count 1 Parent process 29852 with count 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!