Question
create a multi-threaded program which will do the following: 1. Start accepting up to any number of integer parameters on the command line, referred to
create a multi-threaded program which will do the following:
1. Start accepting up to any number of integer parameters on the command line, referred to as n.
2. Spawn two threads. The first thread will convert the numbers between 0 and n/2 from their ASCII string representations into floating point numbers and sum them. The second thread will do the same for the numbers between n/2 and n. In each case, the results will be placed in an instance of a structure that is passed to the thread as a parameter.
3. After both threads have finished, the main thread will sum the results from thread 1 and thread 2 and then calculate the average.
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