Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Operating Systems: Create two applications that will calculate basic statistics about a collection of data using multiple process and multiple threads respectively. The master thread/parent
Operating Systems:
Create two applications that will calculate basic statistics about a collection of data using multiple process and multiple threads respectively. The master thread/parent process should read the data from a file and then spawn the child threads/child processes to process the data. Example: gbarlas@kinpenguin: ./statFork 4 data.txt Min: 10 Max: 1253 Average: 128.64 should generate four child processes (so five in total) to process the data. A similar convention of calling should be done for the multi-threaded program. E.g. gbarlas@kinpenguin: $./statThread 4 data.txt Min: 10 The data file should be a text file that has a number per line and starts with the total number of data items in the first line. E.g.: 1000 346.4 7798.2 ... // 998 more lines follow Use pipelines to allow the parent process collection of the partial results from the children. In the case of threads, shared data can be utilized. Once you complete and test your code, test and compare the performance of the two programs for different number of child processes and threads, i.e. find the execution times and calculate the speedup (the parent should be also computing part of the result). A graph showing your results for 2,4,6 and 8 processes/threads should be provided
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started