Please do it in c++,c# or java.It should use multithreading concept. In this lab, you will implement a multithreaded sum

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Please do it in c++,c# or java.It should use multithreading concept. In this lab, you will implement a multithreaded sum

Post by answerhappygod »

Please do it in c++,c# or java.It should use multithreading
concept.
In this lab, you will implement a multithreaded sum application
in a language that supports parallelism (not Python). Your program
will sum up all the numbers from 1 to 500,000,000. The result
should be 125,000,000,250,000,000. You should define a function for
each of the following approaches. Each function should be timed so
that you can print out how long the operation took. Approach 1:
Single threaded sum Approach 2: Multithreaded sum. For this
approach, you should test with a variable number of threads ranging
from 2 to (at least) 10. The work should be split in numerical
order. For example, if you have 2 threads, thread 1 should sum up
the first half of the numbers and thread 2 should handle the second
half. Approach 3: Balanced multithreaded sum. For this approach,
you should test with a variable number of threads ranging from 2 to
(at least) 10. The work should be split in numerical order. For
example, if you have 2 threads, thread 1 should sum up the odd
numbers and thread 2 should handle the evens. With 3 threads,
thread 1 would handle 1, 4, 7, ..., thread 2 would handle 2, 5, 8,
..., and thread 3 would handle 3, 6, 9, ..., etc.
Please give your CPU and the number of cores + threads.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply