Question: Write a multithreaded program (either in C or Java) that calculates various statistical values for a list of numbers. The program will be passed a

Write a multithreaded program (either in C or Java) that calculates various statistical values for a list of numbers. The program will be passed a series of numbers on the command line (the examples we covered during the last lecture illustrates how to handle command line arguments both n C and Java), and will then create three separate worker threads. One thread will determine the average of the numbers, one will determine the maximum value, and one will determine the minimum value. For example, suppose your program is passed the integers 90 81 78 95 72 85 The main thread of your program should produce the output: The average value is 82 The maximum value is 95 The minimum value is 72 The main thread should wait for all worker threads to finish their jobs and exit before generating the output as given above. b) What type of parallelism is achieved with the execution of your program on the data given? Why?

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!