Question: MUST BE IN C++ Create an program that accepts two arguments from the command line First argument is the number of threads to create Second

MUST BE IN C++

  • Create an program that accepts two arguments from the command line
  • First argument is the number of threads to create
  • Second argument file that contains a list of integers
    • The first element in the list is the number of preceding elements.
      • 5 10 20 30 40 50 is a list of 5 elements with values 10 50. (example of command line input, 5 is argument one, 10 20 30 40 50 is argument two)
  • Each thread will sum its portion of the list. This will be done globally. So if we have 5 elements and two threads, one thread will sum two elements and one will sum 3. Then the thread sums are totaled.
  • Display the total sum.

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!