Comparing the results of your experiments in Exercise 31 with the performance obtained from the approach in
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 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 Answer:
C++ Plus Data Structures
ISBN: 9781284089189
6th Edition
Authors: Nell Dale, Chip Weems, Tim Richards