# HG changeset patch # User brutisso # Date 1351625204 -3600 # Node ID 3dfffc8b97222ce95b723c08e6d1cb22751b6323 # Parent 3fadc0e8cffeba479b1eaec3458a7e7a1c2a29b1 8001564: The load balancing function steal_1_random in taskqueue is not random Summary: Removes the two unused functions GenericTaskQueueSet::steal_1_random and GenericTaskQueueSet::steal_best_of_all Reviewed-by: brutisso, stefank Contributed-by: erik.x.helin@oracle.com diff -r 3fadc0e8cffe -r 3dfffc8b9722 src/share/vm/utilities/taskqueue.hpp --- a/src/share/vm/utilities/taskqueue.hpp Tue Oct 30 10:23:55 2012 -0700 +++ b/src/share/vm/utilities/taskqueue.hpp Tue Oct 30 20:26:44 2012 +0100 @@ -496,9 +496,7 @@ } } - bool steal_1_random(uint queue_num, int* seed, E& t); bool steal_best_of_2(uint queue_num, int* seed, E& t); - bool steal_best_of_all(uint queue_num, int* seed, E& t); void register_queue(uint i, T* q); @@ -538,46 +536,6 @@ } template bool -GenericTaskQueueSet::steal_best_of_all(uint queue_num, int* seed, E& t) { - if (_n > 2) { - int best_k; - uint best_sz = 0; - for (uint k = 0; k < _n; k++) { - if (k == queue_num) continue; - uint sz = _queues[k]->size(); - if (sz > best_sz) { - best_sz = sz; - best_k = k; - } - } - return best_sz > 0 && _queues[best_k]->pop_global(t); - } else if (_n == 2) { - // Just try the other one. - int k = (queue_num + 1) % 2; - return _queues[k]->pop_global(t); - } else { - assert(_n == 1, "can't be zero."); - return false; - } -} - -template bool -GenericTaskQueueSet::steal_1_random(uint queue_num, int* seed, E& t) { - if (_n > 2) { - uint k = queue_num; - while (k == queue_num) k = TaskQueueSetSuper::randomParkAndMiller(seed) % _n; - return _queues[2]->pop_global(t); - } else if (_n == 2) { - // Just try the other one. - int k = (queue_num + 1) % 2; - return _queues[k]->pop_global(t); - } else { - assert(_n == 1, "can't be zero."); - return false; - } -} - -template bool GenericTaskQueueSet::steal_best_of_2(uint queue_num, int* seed, E& t) { if (_n > 2) { uint k1 = queue_num;