Question: Use your code from p 1 . c and implement a timer which will count how many seconds each thread has taken. Print out the
Use your code from pc and implement a timer which will count how many seconds each thread has taken. Print out the following:
Thread duration Marks
Thread duration Marks
Total duration how long it takes both process to complete Marks
Average time taken for a process to complete Marks
In addition, modify the code to use IPC share memorypointers to pass a long variable from the parent to child process and print it in the child process.
For Thread pass and print the number Marks
For Thread pass and print the number Marks
Expected Output:
Shared memory Thread value:
Shared memory Thread value:
thread took seconds to execute
thread took seconds to execute
thread and thread took seconds to execute
average time taken was
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
