Mercurial > hg > graal-compiler
comparison src/share/vm/utilities/taskqueue.cpp @ 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 | f95d63e2154a |
comparison
equal
deleted
inserted
replaced
1781:97fbf5beff7b | 1833:8b10f48633dc |
---|---|
142 os::sleep(Thread::current(), millis, false); | 142 os::sleep(Thread::current(), millis, false); |
143 } | 143 } |
144 | 144 |
145 bool | 145 bool |
146 ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { | 146 ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { |
147 assert(_n_threads > 0, "Initialization is incorrect"); | |
147 assert(_offered_termination < _n_threads, "Invariant"); | 148 assert(_offered_termination < _n_threads, "Invariant"); |
148 Atomic::inc(&_offered_termination); | 149 Atomic::inc(&_offered_termination); |
149 | 150 |
150 uint yield_count = 0; | 151 uint yield_count = 0; |
151 // Number of hard spin loops done since last yield | 152 // Number of hard spin loops done since last yield |
253 bool ObjArrayTask::is_valid() const { | 254 bool ObjArrayTask::is_valid() const { |
254 return _obj != NULL && _obj->is_objArray() && _index > 0 && | 255 return _obj != NULL && _obj->is_objArray() && _index > 0 && |
255 _index < objArrayOop(_obj)->length(); | 256 _index < objArrayOop(_obj)->length(); |
256 } | 257 } |
257 #endif // ASSERT | 258 #endif // ASSERT |
259 | |
260 void ParallelTaskTerminator::reset_for_reuse(int n_threads) { | |
261 reset_for_reuse(); | |
262 _n_threads = n_threads; | |
263 } | |
264 |