Question: DO THIS IN C AND SHOW BOTH OUTPUTS RUNNING PLEASE! In this assessment, you are required to demonstrate the use of threading and provide an

DO THIS IN C AND SHOW BOTH OUTPUTS RUNNING PLEASE!
In this assessment, you are required to demonstrate the use of threading and provide an evidence of performance boost of the program using the built-in threading libraries. The assessment is twofolds. Below are the requirements of the assessment: Fold 1: You are required to write a program in C that takes (1,000,000,000) as an input (you are free to take this input from command line arguments or from the user). Once the input is taken, there should be 3 threads in your program performing the following operations: 1. Child Thread 1: a. Displays its ID b. Find incremental sum of all the numbers until and including 1,000,000,000 c. Exit itself once completed the operation 2. Child Thread 2 : a. Displays its ID b. Find incremental sum of all the even numbers until and including 1,000,000,000 c. Exit itself once completed the operation 3. Parent / Main Thread: a. Displays its ID b. Creates Child Threads 1 and 2 c. Merges Child Thread 1 and 2 d. Displays the sum of all the numbers returned by Child Thread 1 e. Displays the sum of all the numbers returned by Child Thread 2 f. Calculates the following: i. sum of all the numbers returned by Child Thread 1/ sum of all the numbers returned by Child Thread 2 g. Displays the result of above calculation Requirement 1: Analyze the time taken by the program to complete, e.g., review the usage of cores using Activity Monitor program in Ubuntu and find a way to monitor the time taken by the program to complete its execution. Furthermore, make sure, the calculations made by the program are correct and accurate. Do NOT forget to take a screenshot of the Activity Monitor. Fold 2: You are required to write a program in C that takes (1,000,000,000) as an input (you are free to take this input from command line arguments or from the user). Once the input is taken, the program should perform the following operations: 1. Find incremental sum of all the numbers until and including 1,000,000,000 2. Find incremental sum of all the even numbers until and including 1,000,000,000 3. Display the sum of all the numbers until and including 1,000,000,000 4. Displays the sum of all the even numbers until and including 1,000,000,000 5. Calculates the following: - sum of all the numbers in Step 1 / sum of all the numbers in Step 2 6. Displays the result of above calculation Requirement 2: Analyze the time taken by the program to complete, e.g., review the usage of cores using Activity Monitor program in Ubuntu and find a way to monitor the time taken by the program to complete its execution. Do NOT forget to take a screenshot of the Activity Monitor
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
