Question: Write a C program and PLz also include the output Note: the output must have few negative numbers. A Child Needs its Space It is

 Write a C program and PLz also include the output Note:

Write a C program and PLz also include the output

Note: the output must have few negative numbers.

A Child Needs its Space It is known that a child process runs in its own address space, while its parent process runs in its own address space. We will use the Threesum algorithm to illustrate this. Write a program the spawns a child process from the parent process. In the child process implement the Threes algorithm. As we know, the Threesum algorithm has N-cubed order and hence takes a long time to complete (especially for larger files of numbers). Use the clock() function to compute the time it takes to run the program. Start the clock at the beginning of the program and end it at the end of the program then compute the execution time. This may give a surprising result, especially for larger files of numbers as you wait for the program to execute. Then begin the clock inside (at the beginning) the child process and end it at the end of the child process. Compute the execution time of the child process and note it and the time of the parent process and note that. Try this with the C system wait() function (so the parent waits for the child to complete) and without the wait() function What do you think caused these results? Explain! You should make a table (and/or graph) of your results and then an objective analysis. Note, to obtain interesting results and use a larger file of numbers, you may want to use the unsigned long int data type with the format specifier %lu or unsigned long long with format specifier %llu, or %lld for just long long

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!