
Edouard A. wrote:
template <typename RandomIterator, typename Pool> void rec_pivot_partition(RandomIterator first, RandomIterator last, Pool & p) { if (std::distance(first, last) > 1000) { RandomIterator pivot = pivot_partition(first, last); rec_pivot_partition(first, pivot, p); rec_pivot_partition(pivot, last, p); }
So you are doing all of the partitioning in the main thread, before starting any other threads? Have you profiled that?
const difference_type block_size = 1000;
Have you benchmarked the effect of adjusting that? If that is sufficiently large, the performance of the threadpool queue (etc) will not matter as much. I suggest that you also tweak your benchmarking so that it runs for a *lot* longer than 30 milliseconds. Phil.