Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a multithreaded program that calculates various statistical values for a list of numeric values. Use the C + + 1 1 std::thread code. This
Write a multithreaded program that calculates various statistical values for a list of numeric values. Use the C std::thread code.
This program is passed a series of numbers on the command line. This program will then create three separate worker threads: one will
determine the average of the numbers, a second and third will determine the maximum and minimum values respectively
For example, if your program is passed the integers
It would print:
avg is
The largest number is
The smallest number is
The minimum amount of numbers a person can pass is There is no maximum number of values the person can enter. If the person does
not pass any numbers show an error instead of creating threads. Only use the amount of space that you need, and do not allocate extra.
When you make each thread use a different method. One should use function pointers, one should use functors and the last should use
lambdas
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