Mercurial > hg > graal-compiler
diff src/share/vm/utilities/taskqueue.hpp @ 1833:8b10f48633dc
6984287: Regularize how GC parallel workers are specified.
Summary: Associate number of GC workers with the workgang as opposed to the task.
Reviewed-by: johnc, ysr
author | jmasa |
---|---|
date | Mon, 20 Sep 2010 14:38:38 -0700 |
parents | 5f429ee79634 |
children | 894b1d7c7e01 |
line wrap: on
line diff
--- a/src/share/vm/utilities/taskqueue.hpp Thu Sep 16 13:45:55 2010 -0700 +++ b/src/share/vm/utilities/taskqueue.hpp Mon Sep 20 14:38:38 2010 -0700 @@ -305,6 +305,12 @@ return false; } +// pop_local_slow() is done by the owning thread and is trying to +// get the last task in the queue. It will compete with pop_global() +// that will be used by other threads. The tag age is incremented +// whenever the queue goes empty which it will do here if this thread +// gets the last task or in pop_global() if the queue wraps (top == 0 +// and pop_global() succeeds, see pop_global()). template<class E, unsigned int N> bool GenericTaskQueue<E, N>::pop_local_slow(uint localBot, Age oldAge) { // This queue was observed to contain exactly one element; either this @@ -637,6 +643,9 @@ // in an MT-safe manner, once the previous round of use of // the terminator is finished. void reset_for_reuse(); + // Same as above but the number of parallel threads is set to the + // given number. + void reset_for_reuse(int n_threads); #ifdef TRACESPINNING static uint total_yields() { return _total_yields; } @@ -782,3 +791,4 @@ typedef OverflowTaskQueue<size_t> RegionTaskQueue; typedef GenericTaskQueueSet<RegionTaskQueue> RegionTaskQueueSet; +