Question: Comparing the results of your experiments in Exercise 31 with the performance obtained from the approach in Exercise 32, does using a thread count that
Comparing the results of your experiments in Exercise 31 with the performance obtained from the approach in Exercise 32, does using a thread count that is greater than the number available from the hardware ever produce faster performance? Is it possible to get consistently better performance on average, or is it just within the normal range of variation?
Exercise 31
Run the parallel merge sort on your own computer, trying various chunk sizes, to see how much speed-up you can obtain from the available parallelism.
Exercise 32
The C++ thread library provides a function that returns the number of threads that the hardware is capable of running. Modify the parallel merge sort so that the user specifies a minimum chunk size. The program should then use the number of threads available and MAX_ITEMS to determine the largest chunk size that will produce that many threads. If the computed chunk size is larger than what the user specifies, use that instead. Here is how to get the number of threads available: unsigned int maxthreads
= thread::hardware_concurrency();
Step by Step Solution
3.30 Rating (153 Votes )
There are 3 Steps involved in it
The performance comparison between Exercise 31 and Exercise 32 would largely depend on various facto... View full answer
Get step-by-step solutions from verified subject matter experts
