src/share/vm/utilities/taskqueue.hpp

Tue, 04 Feb 2020 18:13:14 +0800

author
aoqi
date
Tue, 04 Feb 2020 18:13:14 +0800
changeset 9806
758c07667682
parent 9756
2be326848943
parent 9784
775e2bf92114
child 10015
eb7ce841ccec
permissions
-rw-r--r--

Merge

duke@435 1 /*
shshahma@8611 2 * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
stefank@2314 25 #ifndef SHARE_VM_UTILITIES_TASKQUEUE_HPP
stefank@2314 26 #define SHARE_VM_UTILITIES_TASKQUEUE_HPP
stefank@2314 27
stefank@2314 28 #include "memory/allocation.hpp"
stefank@2314 29 #include "memory/allocation.inline.hpp"
stefank@2314 30 #include "runtime/mutex.hpp"
goetz@6911 31 #include "runtime/orderAccess.inline.hpp"
zgu@9728 32 #include "utilities/globalDefinitions.hpp"
stefank@2314 33 #include "utilities/stack.hpp"
stefank@2314 34
jcoomes@2020 35 // Simple TaskQueue stats that are collected by default in debug builds.
jcoomes@2020 36
jcoomes@2020 37 #if !defined(TASKQUEUE_STATS) && defined(ASSERT)
jcoomes@2020 38 #define TASKQUEUE_STATS 1
jcoomes@2020 39 #elif !defined(TASKQUEUE_STATS)
jcoomes@2020 40 #define TASKQUEUE_STATS 0
jcoomes@2020 41 #endif
jcoomes@2020 42
jcoomes@2020 43 #if TASKQUEUE_STATS
jcoomes@2020 44 #define TASKQUEUE_STATS_ONLY(code) code
jcoomes@2020 45 #else
jcoomes@2020 46 #define TASKQUEUE_STATS_ONLY(code)
jcoomes@2020 47 #endif // TASKQUEUE_STATS
jcoomes@2020 48
jcoomes@2020 49 #if TASKQUEUE_STATS
jcoomes@2020 50 class TaskQueueStats {
jcoomes@2020 51 public:
jcoomes@2020 52 enum StatId {
jcoomes@2020 53 push, // number of taskqueue pushes
jcoomes@2020 54 pop, // number of taskqueue pops
jcoomes@2020 55 pop_slow, // subset of taskqueue pops that were done slow-path
jcoomes@2020 56 steal_attempt, // number of taskqueue steal attempts
jcoomes@2020 57 steal, // number of taskqueue steals
jcoomes@2020 58 overflow, // number of overflow pushes
jcoomes@2020 59 overflow_max_len, // max length of overflow stack
jcoomes@2020 60 last_stat_id
jcoomes@2020 61 };
jcoomes@2020 62
jcoomes@2020 63 public:
jcoomes@2020 64 inline TaskQueueStats() { reset(); }
jcoomes@2020 65
jcoomes@2020 66 inline void record_push() { ++_stats[push]; }
jcoomes@2020 67 inline void record_pop() { ++_stats[pop]; }
jcoomes@2020 68 inline void record_pop_slow() { record_pop(); ++_stats[pop_slow]; }
jcoomes@2020 69 inline void record_steal(bool success);
jcoomes@2020 70 inline void record_overflow(size_t new_length);
jcoomes@2020 71
jcoomes@2064 72 TaskQueueStats & operator +=(const TaskQueueStats & addend);
jcoomes@2064 73
jcoomes@2020 74 inline size_t get(StatId id) const { return _stats[id]; }
jcoomes@2020 75 inline const size_t* get() const { return _stats; }
jcoomes@2020 76
jcoomes@2020 77 inline void reset();
jcoomes@2020 78
jcoomes@2064 79 // Print the specified line of the header (does not include a line separator).
jcoomes@2020 80 static void print_header(unsigned int line, outputStream* const stream = tty,
jcoomes@2020 81 unsigned int width = 10);
jcoomes@2064 82 // Print the statistics (does not include a line separator).
jcoomes@2020 83 void print(outputStream* const stream = tty, unsigned int width = 10) const;
jcoomes@2020 84
jcoomes@2064 85 DEBUG_ONLY(void verify() const;)
jcoomes@2064 86
jcoomes@2020 87 private:
jcoomes@2020 88 size_t _stats[last_stat_id];
jcoomes@2020 89 static const char * const _names[last_stat_id];
jcoomes@2020 90 };
jcoomes@2020 91
jcoomes@2020 92 void TaskQueueStats::record_steal(bool success) {
jcoomes@2020 93 ++_stats[steal_attempt];
jcoomes@2020 94 if (success) ++_stats[steal];
jcoomes@2020 95 }
jcoomes@2020 96
jcoomes@2020 97 void TaskQueueStats::record_overflow(size_t new_len) {
jcoomes@2020 98 ++_stats[overflow];
jcoomes@2020 99 if (new_len > _stats[overflow_max_len]) _stats[overflow_max_len] = new_len;
jcoomes@2020 100 }
jcoomes@2020 101
jcoomes@2020 102 void TaskQueueStats::reset() {
jcoomes@2020 103 memset(_stats, 0, sizeof(_stats));
jcoomes@2020 104 }
jcoomes@2020 105 #endif // TASKQUEUE_STATS
jcoomes@2020 106
tschatzl@5555 107 // TaskQueueSuper collects functionality common to all GenericTaskQueue instances.
tschatzl@5555 108
zgu@3900 109 template <unsigned int N, MEMFLAGS F>
zgu@3900 110 class TaskQueueSuper: public CHeapObj<F> {
duke@435 111 protected:
jcoomes@1342 112 // Internal type for indexing the queue; also used for the tag.
jcoomes@1342 113 typedef NOT_LP64(uint16_t) LP64_ONLY(uint32_t) idx_t;
jcoomes@1342 114
fujie@9138 115 #ifdef MIPS
fujie@415 116 private:
fujie@415 117 #endif
jcoomes@1342 118 // The first free element after the last one pushed (mod N).
ysr@976 119 volatile uint _bottom;
duke@435 120
fujie@9138 121 #ifdef MIPS
fujie@415 122 protected:
fujie@415 123 inline uint get_bottom() const {
fujie@415 124 return OrderAccess::load_acquire((volatile juint*)&_bottom);
fujie@415 125 }
fujie@415 126
fujie@415 127 inline void set_bottom(uint new_bottom) {
fujie@415 128 OrderAccess::release_store(&_bottom, new_bottom);
fujie@415 129 }
fujie@415 130 #endif
fujie@415 131
jcoomes@1746 132 enum { MOD_N_MASK = N - 1 };
duke@435 133
jcoomes@1342 134 class Age {
jcoomes@1342 135 public:
jcoomes@1342 136 Age(size_t data = 0) { _data = data; }
jcoomes@1342 137 Age(const Age& age) { _data = age._data; }
jcoomes@1342 138 Age(idx_t top, idx_t tag) { _fields._top = top; _fields._tag = tag; }
duke@435 139
fujie@9138 140 #ifndef MIPS
jcoomes@1342 141 Age get() const volatile { return _data; }
jcoomes@1342 142 void set(Age age) volatile { _data = age._data; }
duke@435 143
jcoomes@1342 144 idx_t top() const volatile { return _fields._top; }
jcoomes@1342 145 idx_t tag() const volatile { return _fields._tag; }
fujie@415 146 #else
aoqi@8860 147 Age get() const volatile {
fujie@415 148 size_t res = OrderAccess::load_ptr_acquire((volatile intptr_t*) &_data);
fujie@415 149 return *(Age*)(&res);
fujie@415 150 }
aoqi@8860 151 void set(Age age) volatile { OrderAccess::release_store_ptr((volatile intptr_t*) &_data, *(size_t*)(&age._data)); }
fujie@415 152
fujie@415 153 idx_t top() const volatile { return OrderAccess::load_acquire((volatile idx_t*) &(_fields._top)); }
fujie@415 154 idx_t tag() const volatile { return OrderAccess::load_acquire((volatile idx_t*) &(_fields._tag)); }
fujie@415 155 #endif
duke@435 156
jcoomes@1342 157 // Increment top; if it wraps, increment tag also.
jcoomes@1342 158 void increment() {
jcoomes@1342 159 _fields._top = increment_index(_fields._top);
jcoomes@1342 160 if (_fields._top == 0) ++_fields._tag;
jcoomes@1342 161 }
duke@435 162
jcoomes@1342 163 Age cmpxchg(const Age new_age, const Age old_age) volatile {
jcoomes@1342 164 return (size_t) Atomic::cmpxchg_ptr((intptr_t)new_age._data,
jcoomes@1342 165 (volatile intptr_t *)&_data,
jcoomes@1342 166 (intptr_t)old_age._data);
duke@435 167 }
jcoomes@1342 168
jcoomes@1342 169 bool operator ==(const Age& other) const { return _data == other._data; }
jcoomes@1342 170
jcoomes@1342 171 private:
jcoomes@1342 172 struct fields {
jcoomes@1342 173 idx_t _top;
jcoomes@1342 174 idx_t _tag;
jcoomes@1342 175 };
jcoomes@1342 176 union {
jcoomes@1342 177 size_t _data;
jcoomes@1342 178 fields _fields;
jcoomes@1342 179 };
duke@435 180 };
jcoomes@1342 181
jcoomes@1342 182 volatile Age _age;
jcoomes@1342 183
jcoomes@1342 184 // These both operate mod N.
jcoomes@1342 185 static uint increment_index(uint ind) {
jcoomes@1342 186 return (ind + 1) & MOD_N_MASK;
duke@435 187 }
jcoomes@1342 188 static uint decrement_index(uint ind) {
jcoomes@1342 189 return (ind - 1) & MOD_N_MASK;
duke@435 190 }
duke@435 191
jcoomes@1342 192 // Returns a number in the range [0..N). If the result is "N-1", it should be
jcoomes@1342 193 // interpreted as 0.
jcoomes@1746 194 uint dirty_size(uint bot, uint top) const {
jcoomes@1342 195 return (bot - top) & MOD_N_MASK;
duke@435 196 }
duke@435 197
duke@435 198 // Returns the size corresponding to the given "bot" and "top".
jcoomes@1746 199 uint size(uint bot, uint top) const {
ysr@976 200 uint sz = dirty_size(bot, top);
jcoomes@1342 201 // Has the queue "wrapped", so that bottom is less than top? There's a
jcoomes@1342 202 // complicated special case here. A pair of threads could perform pop_local
jcoomes@1342 203 // and pop_global operations concurrently, starting from a state in which
jcoomes@1342 204 // _bottom == _top+1. The pop_local could succeed in decrementing _bottom,
jcoomes@1342 205 // and the pop_global in incrementing _top (in which case the pop_global
jcoomes@1342 206 // will be awarded the contested queue element.) The resulting state must
jcoomes@1342 207 // be interpreted as an empty queue. (We only need to worry about one such
jcoomes@1342 208 // event: only the queue owner performs pop_local's, and several concurrent
jcoomes@1342 209 // threads attempting to perform the pop_global will all perform the same
jcoomes@1342 210 // CAS, and only one can succeed.) Any stealing thread that reads after
jcoomes@1342 211 // either the increment or decrement will see an empty queue, and will not
jcoomes@1342 212 // join the competitors. The "sz == -1 || sz == N-1" state will not be
jcoomes@1342 213 // modified by concurrent queues, so the owner thread can reset the state to
jcoomes@1342 214 // _bottom == top so subsequent pushes will be performed normally.
jcoomes@1342 215 return (sz == N - 1) ? 0 : sz;
duke@435 216 }
duke@435 217
duke@435 218 public:
duke@435 219 TaskQueueSuper() : _bottom(0), _age() {}
duke@435 220
jcoomes@1993 221 // Return true if the TaskQueue contains/does not contain any tasks.
aoqi@8860 222 bool peek() const {
fujie@9138 223 #ifdef MIPS
aoqi@8860 224 return get_bottom() != _age.top();
fujie@415 225 #else
aoqi@8860 226 return _bottom != _age.top();
fujie@415 227 #endif
fujie@415 228 }
jcoomes@1993 229 bool is_empty() const { return size() == 0; }
duke@435 230
duke@435 231 // Return an estimate of the number of elements in the queue.
duke@435 232 // The "careful" version admits the possibility of pop_local/pop_global
duke@435 233 // races.
jcoomes@1746 234 uint size() const {
fujie@9138 235 #ifdef MIPS
fujie@415 236 return size(get_bottom(), _age.top());
fujie@415 237 #else
jcoomes@1342 238 return size(_bottom, _age.top());
fujie@415 239 #endif
duke@435 240 }
duke@435 241
jcoomes@1746 242 uint dirty_size() const {
fujie@9138 243 #ifdef MIPS
fujie@415 244 return dirty_size(get_bottom(), _age.top());
fujie@415 245 #else
jcoomes@1342 246 return dirty_size(_bottom, _age.top());
fujie@415 247 #endif
duke@435 248 }
duke@435 249
ysr@777 250 void set_empty() {
fujie@9138 251 #ifdef MIPS
fujie@415 252 set_bottom(0);
fujie@415 253 #else
ysr@777 254 _bottom = 0;
fujie@415 255 #endif
jcoomes@1342 256 _age.set(0);
ysr@777 257 }
ysr@777 258
duke@435 259 // Maximum number of elements allowed in the queue. This is two less
duke@435 260 // than the actual queue size, for somewhat complicated reasons.
jcoomes@1746 261 uint max_elems() const { return N - 2; }
jmasa@1719 262
jmasa@1719 263 // Total size of queue.
jmasa@1719 264 static const uint total_size() { return N; }
jcoomes@2020 265
jcoomes@2020 266 TASKQUEUE_STATS_ONLY(TaskQueueStats stats;)
duke@435 267 };
duke@435 268
tschatzl@5555 269 //
tschatzl@5555 270 // GenericTaskQueue implements an ABP, Aurora-Blumofe-Plaxton, double-
tschatzl@5555 271 // ended-queue (deque), intended for use in work stealing. Queue operations
tschatzl@5555 272 // are non-blocking.
tschatzl@5555 273 //
tschatzl@5555 274 // A queue owner thread performs push() and pop_local() operations on one end
tschatzl@5555 275 // of the queue, while other threads may steal work using the pop_global()
tschatzl@5555 276 // method.
tschatzl@5555 277 //
tschatzl@5555 278 // The main difference to the original algorithm is that this
tschatzl@5555 279 // implementation allows wrap-around at the end of its allocated
tschatzl@5555 280 // storage, which is an array.
tschatzl@5555 281 //
tschatzl@5555 282 // The original paper is:
tschatzl@5555 283 //
tschatzl@5555 284 // Arora, N. S., Blumofe, R. D., and Plaxton, C. G.
tschatzl@5555 285 // Thread scheduling for multiprogrammed multiprocessors.
tschatzl@5555 286 // Theory of Computing Systems 34, 2 (2001), 115-144.
tschatzl@5555 287 //
tschatzl@5555 288 // The following paper provides an correctness proof and an
tschatzl@5555 289 // implementation for weakly ordered memory models including (pseudo-)
tschatzl@5555 290 // code containing memory barriers for a Chase-Lev deque. Chase-Lev is
tschatzl@5555 291 // similar to ABP, with the main difference that it allows resizing of the
tschatzl@5555 292 // underlying storage:
tschatzl@5555 293 //
tschatzl@5555 294 // Le, N. M., Pop, A., Cohen A., and Nardell, F. Z.
tschatzl@5555 295 // Correct and efficient work-stealing for weak memory models
tschatzl@5555 296 // Proceedings of the 18th ACM SIGPLAN symposium on Principles and
tschatzl@5555 297 // practice of parallel programming (PPoPP 2013), 69-80
tschatzl@5555 298 //
zgu@3900 299
zgu@3900 300 template <class E, MEMFLAGS F, unsigned int N = TASKQUEUE_SIZE>
zgu@3900 301 class GenericTaskQueue: public TaskQueueSuper<N, F> {
brutisso@4901 302 ArrayAllocator<E, F> _array_allocator;
jcoomes@1746 303 protected:
zgu@3900 304 typedef typename TaskQueueSuper<N, F>::Age Age;
zgu@3900 305 typedef typename TaskQueueSuper<N, F>::idx_t idx_t;
jcoomes@1746 306
fujie@9138 307 #ifndef MIPS
zgu@3900 308 using TaskQueueSuper<N, F>::_bottom;
fujie@415 309 #endif
zgu@3900 310 using TaskQueueSuper<N, F>::_age;
zgu@3900 311 using TaskQueueSuper<N, F>::increment_index;
zgu@3900 312 using TaskQueueSuper<N, F>::decrement_index;
zgu@3900 313 using TaskQueueSuper<N, F>::dirty_size;
jcoomes@1746 314
jcoomes@1746 315 public:
zgu@3900 316 using TaskQueueSuper<N, F>::max_elems;
zgu@3900 317 using TaskQueueSuper<N, F>::size;
zgu@3900 318
zgu@3900 319 #if TASKQUEUE_STATS
zgu@3900 320 using TaskQueueSuper<N, F>::stats;
zgu@3900 321 #endif
jcoomes@1746 322
duke@435 323 private:
duke@435 324 // Slow paths for push, pop_local. (pop_global has no fast path.)
ysr@976 325 bool push_slow(E t, uint dirty_n_elems);
ysr@976 326 bool pop_local_slow(uint localBot, Age oldAge);
duke@435 327
duke@435 328 public:
jcoomes@1746 329 typedef E element_type;
jcoomes@1746 330
duke@435 331 // Initializes the queue to empty.
duke@435 332 GenericTaskQueue();
duke@435 333
duke@435 334 void initialize();
duke@435 335
jcoomes@1993 336 // Push the task "t" on the queue. Returns "false" iff the queue is full.
duke@435 337 inline bool push(E t);
duke@435 338
jcoomes@1993 339 // Attempts to claim a task from the "local" end of the queue (the most
jcoomes@1993 340 // recently pushed). If successful, returns true and sets t to the task;
jcoomes@1993 341 // otherwise, returns false (the queue is empty).
hseigel@5784 342 inline bool pop_local(volatile E& t);
duke@435 343
jcoomes@1993 344 // Like pop_local(), but uses the "global" end of the queue (the least
jcoomes@1993 345 // recently pushed).
hseigel@5784 346 bool pop_global(volatile E& t);
duke@435 347
duke@435 348 // Delete any resource associated with the queue.
duke@435 349 ~GenericTaskQueue();
duke@435 350
ysr@777 351 // apply the closure to all elements in the task queue
ysr@777 352 void oops_do(OopClosure* f);
ysr@777 353
duke@435 354 private:
duke@435 355 // Element array.
duke@435 356 volatile E* _elems;
duke@435 357 };
duke@435 358
zgu@3900 359 template<class E, MEMFLAGS F, unsigned int N>
zgu@3900 360 GenericTaskQueue<E, F, N>::GenericTaskQueue() {
jcoomes@1342 361 assert(sizeof(Age) == sizeof(size_t), "Depends on this.");
duke@435 362 }
duke@435 363
zgu@3900 364 template<class E, MEMFLAGS F, unsigned int N>
zgu@3900 365 void GenericTaskQueue<E, F, N>::initialize() {
brutisso@4901 366 _elems = _array_allocator.allocate(N);
duke@435 367 }
duke@435 368
zgu@3900 369 template<class E, MEMFLAGS F, unsigned int N>
zgu@3900 370 void GenericTaskQueue<E, F, N>::oops_do(OopClosure* f) {
ysr@777 371 // tty->print_cr("START OopTaskQueue::oops_do");
ysr@976 372 uint iters = size();
fujie@9138 373 #ifdef MIPS
fujie@415 374 uint index = this->get_bottom();
fujie@415 375 #else
ysr@976 376 uint index = _bottom;
fujie@415 377 #endif
ysr@976 378 for (uint i = 0; i < iters; ++i) {
ysr@777 379 index = decrement_index(index);
ysr@777 380 // tty->print_cr(" doing entry %d," INTPTR_T " -> " INTPTR_T,
ysr@777 381 // index, &_elems[index], _elems[index]);
ysr@777 382 E* t = (E*)&_elems[index]; // cast away volatility
ysr@777 383 oop* p = (oop*)t;
ysr@777 384 assert((*t)->is_oop_or_null(), "Not an oop or null");
ysr@777 385 f->do_oop(p);
ysr@777 386 }
ysr@777 387 // tty->print_cr("END OopTaskQueue::oops_do");
ysr@777 388 }
ysr@777 389
zgu@3900 390 template<class E, MEMFLAGS F, unsigned int N>
zgu@3900 391 bool GenericTaskQueue<E, F, N>::push_slow(E t, uint dirty_n_elems) {
jcoomes@1342 392 if (dirty_n_elems == N - 1) {
duke@435 393 // Actually means 0, so do the push.
fujie@9138 394 #ifdef MIPS
fujie@415 395 uint localBot = this->get_bottom();
fujie@415 396 #else
ysr@976 397 uint localBot = _bottom;
fujie@415 398 #endif
ccheung@5259 399 // g++ complains if the volatile result of the assignment is
ccheung@5259 400 // unused, so we cast the volatile away. We cannot cast directly
ccheung@5259 401 // to void, because gcc treats that as not using the result of the
ccheung@5259 402 // assignment. However, casting to E& means that we trigger an
ccheung@5259 403 // unused-value warning. So, we cast the E& to void.
ccheung@5259 404 (void)const_cast<E&>(_elems[localBot] = t);
fujie@9138 405 #ifdef MIPS
fujie@415 406 this->set_bottom(increment_index(localBot));
fujie@415 407 #else
bobv@1459 408 OrderAccess::release_store(&_bottom, increment_index(localBot));
fujie@415 409 #endif
jcoomes@2020 410 TASKQUEUE_STATS_ONLY(stats.record_push());
duke@435 411 return true;
jcoomes@1342 412 }
jcoomes@1342 413 return false;
duke@435 414 }
duke@435 415
jmasa@2188 416 // pop_local_slow() is done by the owning thread and is trying to
jmasa@2188 417 // get the last task in the queue. It will compete with pop_global()
jmasa@2188 418 // that will be used by other threads. The tag age is incremented
jmasa@2188 419 // whenever the queue goes empty which it will do here if this thread
jmasa@2188 420 // gets the last task or in pop_global() if the queue wraps (top == 0
jmasa@2188 421 // and pop_global() succeeds, see pop_global()).
zgu@3900 422 template<class E, MEMFLAGS F, unsigned int N>
zgu@3900 423 bool GenericTaskQueue<E, F, N>::pop_local_slow(uint localBot, Age oldAge) {
duke@435 424 // This queue was observed to contain exactly one element; either this
duke@435 425 // thread will claim it, or a competing "pop_global". In either case,
duke@435 426 // the queue will be logically empty afterwards. Create a new Age value
duke@435 427 // that represents the empty queue for the given value of "_bottom". (We
duke@435 428 // must also increment "tag" because of the case where "bottom == 1",
duke@435 429 // "top == 0". A pop_global could read the queue element in that case,
duke@435 430 // then have the owner thread do a pop followed by another push. Without
duke@435 431 // the incrementing of "tag", the pop_global's CAS could succeed,
duke@435 432 // allowing it to believe it has claimed the stale element.)
jcoomes@1342 433 Age newAge((idx_t)localBot, oldAge.tag() + 1);
duke@435 434 // Perhaps a competing pop_global has already incremented "top", in which
duke@435 435 // case it wins the element.
duke@435 436 if (localBot == oldAge.top()) {
duke@435 437 // No competing pop_global has yet incremented "top"; we'll try to
duke@435 438 // install new_age, thus claiming the element.
jcoomes@1342 439 Age tempAge = _age.cmpxchg(newAge, oldAge);
duke@435 440 if (tempAge == oldAge) {
duke@435 441 // We win.
jcoomes@1342 442 assert(dirty_size(localBot, _age.top()) != N - 1, "sanity");
jcoomes@2020 443 TASKQUEUE_STATS_ONLY(stats.record_pop_slow());
duke@435 444 return true;
duke@435 445 }
duke@435 446 }
jcoomes@1342 447 // We lose; a completing pop_global gets the element. But the queue is empty
jcoomes@1342 448 // and top is greater than bottom. Fix this representation of the empty queue
jcoomes@1342 449 // to become the canonical one.
jcoomes@1342 450 _age.set(newAge);
jcoomes@1342 451 assert(dirty_size(localBot, _age.top()) != N - 1, "sanity");
duke@435 452 return false;
duke@435 453 }
duke@435 454
zgu@3900 455 template<class E, MEMFLAGS F, unsigned int N>
hseigel@5784 456 bool GenericTaskQueue<E, F, N>::pop_global(volatile E& t) {
jcoomes@1342 457 Age oldAge = _age.get();
vladidan@5483 458 // Architectures with weak memory model require a barrier here
vladidan@5483 459 // to guarantee that bottom is not older than age,
vladidan@5483 460 // which is crucial for the correctness of the algorithm.
vladidan@5483 461 #if !(defined SPARC || defined IA32 || defined AMD64)
vladidan@5483 462 OrderAccess::fence();
vladidan@5483 463 #endif
fujie@9138 464 #ifdef MIPS
fujie@415 465 uint localBot = this->get_bottom();
fujie@415 466 #else
vladidan@5483 467 uint localBot = OrderAccess::load_acquire((volatile juint*)&_bottom);
fujie@415 468 #endif
ysr@976 469 uint n_elems = size(localBot, oldAge.top());
duke@435 470 if (n_elems == 0) {
duke@435 471 return false;
duke@435 472 }
jcoomes@1342 473
ccheung@5259 474 // g++ complains if the volatile result of the assignment is
ccheung@5259 475 // unused, so we cast the volatile away. We cannot cast directly
ccheung@5259 476 // to void, because gcc treats that as not using the result of the
ccheung@5259 477 // assignment. However, casting to E& means that we trigger an
ccheung@5259 478 // unused-value warning. So, we cast the E& to void.
ccheung@5259 479 (void) const_cast<E&>(t = _elems[oldAge.top()]);
jcoomes@1342 480 Age newAge(oldAge);
jcoomes@1342 481 newAge.increment();
jcoomes@1342 482 Age resAge = _age.cmpxchg(newAge, oldAge);
jcoomes@1342 483
duke@435 484 // Note that using "_bottom" here might fail, since a pop_local might
duke@435 485 // have decremented it.
jcoomes@1342 486 assert(dirty_size(localBot, newAge.top()) != N - 1, "sanity");
jcoomes@1342 487 return resAge == oldAge;
duke@435 488 }
duke@435 489
zgu@3900 490 template<class E, MEMFLAGS F, unsigned int N>
zgu@3900 491 GenericTaskQueue<E, F, N>::~GenericTaskQueue() {
zgu@3900 492 FREE_C_HEAP_ARRAY(E, _elems, F);
duke@435 493 }
duke@435 494
jcoomes@1993 495 // OverflowTaskQueue is a TaskQueue that also includes an overflow stack for
jcoomes@1993 496 // elements that do not fit in the TaskQueue.
jcoomes@1993 497 //
jcoomes@2191 498 // This class hides two methods from super classes:
jcoomes@1993 499 //
jcoomes@1993 500 // push() - push onto the task queue or, if that fails, onto the overflow stack
jcoomes@1993 501 // is_empty() - return true if both the TaskQueue and overflow stack are empty
jcoomes@1993 502 //
jcoomes@2191 503 // Note that size() is not hidden--it returns the number of elements in the
jcoomes@1993 504 // TaskQueue, and does not include the size of the overflow stack. This
jcoomes@1993 505 // simplifies replacement of GenericTaskQueues with OverflowTaskQueues.
zgu@3900 506 template<class E, MEMFLAGS F, unsigned int N = TASKQUEUE_SIZE>
zgu@3900 507 class OverflowTaskQueue: public GenericTaskQueue<E, F, N>
jcoomes@1993 508 {
jcoomes@1993 509 public:
zgu@3900 510 typedef Stack<E, F> overflow_t;
zgu@3900 511 typedef GenericTaskQueue<E, F, N> taskqueue_t;
jcoomes@1993 512
jcoomes@2020 513 TASKQUEUE_STATS_ONLY(using taskqueue_t::stats;)
jcoomes@2020 514
jcoomes@1993 515 // Push task t onto the queue or onto the overflow stack. Return true.
jcoomes@1993 516 inline bool push(E t);
jcoomes@1993 517
shshahma@8611 518 // Try to push task t onto the queue only. Returns true if successful, false otherwise.
shshahma@8611 519 inline bool try_push_to_taskqueue(E t);
shshahma@8611 520
jcoomes@1993 521 // Attempt to pop from the overflow stack; return true if anything was popped.
jcoomes@1993 522 inline bool pop_overflow(E& t);
jcoomes@1993 523
jcoomes@2191 524 inline overflow_t* overflow_stack() { return &_overflow_stack; }
jcoomes@2191 525
jcoomes@1993 526 inline bool taskqueue_empty() const { return taskqueue_t::is_empty(); }
jcoomes@2191 527 inline bool overflow_empty() const { return _overflow_stack.is_empty(); }
jcoomes@1993 528 inline bool is_empty() const {
jcoomes@1993 529 return taskqueue_empty() && overflow_empty();
jcoomes@1993 530 }
jcoomes@1993 531
jcoomes@1993 532 private:
jcoomes@2191 533 overflow_t _overflow_stack;
jcoomes@1993 534 };
jcoomes@1993 535
zgu@3900 536 template <class E, MEMFLAGS F, unsigned int N>
zgu@3900 537 bool OverflowTaskQueue<E, F, N>::push(E t)
jcoomes@1993 538 {
jcoomes@1993 539 if (!taskqueue_t::push(t)) {
jcoomes@1993 540 overflow_stack()->push(t);
jcoomes@2191 541 TASKQUEUE_STATS_ONLY(stats.record_overflow(overflow_stack()->size()));
jcoomes@1993 542 }
jcoomes@1993 543 return true;
jcoomes@1993 544 }
jcoomes@1993 545
zgu@3900 546 template <class E, MEMFLAGS F, unsigned int N>
zgu@3900 547 bool OverflowTaskQueue<E, F, N>::pop_overflow(E& t)
jcoomes@1993 548 {
jcoomes@1993 549 if (overflow_empty()) return false;
jcoomes@1993 550 t = overflow_stack()->pop();
jcoomes@1993 551 return true;
jcoomes@1993 552 }
jcoomes@1993 553
shshahma@8611 554 template <class E, MEMFLAGS F, unsigned int N>
shshahma@8611 555 bool OverflowTaskQueue<E, F, N>::try_push_to_taskqueue(E t) {
shshahma@8611 556 return taskqueue_t::push(t);
shshahma@8611 557 }
zgu@3900 558 class TaskQueueSetSuper {
duke@435 559 protected:
duke@435 560 static int randomParkAndMiller(int* seed0);
duke@435 561 public:
duke@435 562 // Returns "true" if some TaskQueue in the set contains a task.
duke@435 563 virtual bool peek() = 0;
duke@435 564 };
duke@435 565
zgu@3900 566 template <MEMFLAGS F> class TaskQueueSetSuperImpl: public CHeapObj<F>, public TaskQueueSetSuper {
zgu@3900 567 };
zgu@3900 568
zgu@3900 569 template<class T, MEMFLAGS F>
zgu@3900 570 class GenericTaskQueueSet: public TaskQueueSetSuperImpl<F> {
duke@435 571 private:
ysr@976 572 uint _n;
jcoomes@1746 573 T** _queues;
duke@435 574
duke@435 575 public:
jcoomes@1746 576 typedef typename T::element_type E;
jcoomes@1746 577
duke@435 578 GenericTaskQueueSet(int n) : _n(n) {
jcoomes@1746 579 typedef T* GenericTaskQueuePtr;
zgu@3900 580 _queues = NEW_C_HEAP_ARRAY(GenericTaskQueuePtr, n, F);
duke@435 581 for (int i = 0; i < n; i++) {
duke@435 582 _queues[i] = NULL;
duke@435 583 }
duke@435 584 }
duke@435 585
ysr@976 586 bool steal_best_of_2(uint queue_num, int* seed, E& t);
duke@435 587
jcoomes@1746 588 void register_queue(uint i, T* q);
duke@435 589
jcoomes@1746 590 T* queue(uint n);
duke@435 591
jcoomes@1993 592 // The thread with queue number "queue_num" (and whose random number seed is
jcoomes@1993 593 // at "seed") is trying to steal a task from some other queue. (It may try
jcoomes@1993 594 // several queues, according to some configuration parameter.) If some steal
jcoomes@1993 595 // succeeds, returns "true" and sets "t" to the stolen task, otherwise returns
jcoomes@1993 596 // false.
ysr@976 597 bool steal(uint queue_num, int* seed, E& t);
duke@435 598
duke@435 599 bool peek();
duke@435 600 };
duke@435 601
zgu@3900 602 template<class T, MEMFLAGS F> void
zgu@3900 603 GenericTaskQueueSet<T, F>::register_queue(uint i, T* q) {
ysr@976 604 assert(i < _n, "index out of range.");
duke@435 605 _queues[i] = q;
duke@435 606 }
duke@435 607
zgu@3900 608 template<class T, MEMFLAGS F> T*
zgu@3900 609 GenericTaskQueueSet<T, F>::queue(uint i) {
duke@435 610 return _queues[i];
duke@435 611 }
duke@435 612
zgu@3900 613 template<class T, MEMFLAGS F> bool
zgu@3900 614 GenericTaskQueueSet<T, F>::steal(uint queue_num, int* seed, E& t) {
jcoomes@2020 615 for (uint i = 0; i < 2 * _n; i++) {
jcoomes@2020 616 if (steal_best_of_2(queue_num, seed, t)) {
jcoomes@2020 617 TASKQUEUE_STATS_ONLY(queue(queue_num)->stats.record_steal(true));
duke@435 618 return true;
jcoomes@2020 619 }
jcoomes@2020 620 }
jcoomes@2020 621 TASKQUEUE_STATS_ONLY(queue(queue_num)->stats.record_steal(false));
duke@435 622 return false;
duke@435 623 }
duke@435 624
zgu@3900 625 template<class T, MEMFLAGS F> bool
zgu@3900 626 GenericTaskQueueSet<T, F>::steal_best_of_2(uint queue_num, int* seed, E& t) {
duke@435 627 if (_n > 2) {
ysr@976 628 uint k1 = queue_num;
zgu@3900 629 while (k1 == queue_num) k1 = TaskQueueSetSuper::randomParkAndMiller(seed) % _n;
ysr@976 630 uint k2 = queue_num;
zgu@3900 631 while (k2 == queue_num || k2 == k1) k2 = TaskQueueSetSuper::randomParkAndMiller(seed) % _n;
duke@435 632 // Sample both and try the larger.
ysr@976 633 uint sz1 = _queues[k1]->size();
ysr@976 634 uint sz2 = _queues[k2]->size();
duke@435 635 if (sz2 > sz1) return _queues[k2]->pop_global(t);
duke@435 636 else return _queues[k1]->pop_global(t);
duke@435 637 } else if (_n == 2) {
duke@435 638 // Just try the other one.
ysr@976 639 uint k = (queue_num + 1) % 2;
duke@435 640 return _queues[k]->pop_global(t);
duke@435 641 } else {
duke@435 642 assert(_n == 1, "can't be zero.");
duke@435 643 return false;
duke@435 644 }
duke@435 645 }
duke@435 646
zgu@3900 647 template<class T, MEMFLAGS F>
zgu@3900 648 bool GenericTaskQueueSet<T, F>::peek() {
duke@435 649 // Try all the queues.
ysr@976 650 for (uint j = 0; j < _n; j++) {
duke@435 651 if (_queues[j]->peek())
duke@435 652 return true;
duke@435 653 }
duke@435 654 return false;
duke@435 655 }
duke@435 656
ysr@777 657 // When to terminate from the termination protocol.
zgu@3900 658 class TerminatorTerminator: public CHeapObj<mtInternal> {
ysr@777 659 public:
ysr@777 660 virtual bool should_exit_termination() = 0;
ysr@777 661 };
ysr@777 662
duke@435 663 // A class to aid in the termination of a set of parallel tasks using
duke@435 664 // TaskQueueSet's for work stealing.
duke@435 665
jmasa@981 666 #undef TRACESPINNING
jmasa@981 667
duke@435 668 class ParallelTaskTerminator: public StackObj {
duke@435 669 private:
duke@435 670 int _n_threads;
duke@435 671 TaskQueueSetSuper* _queue_set;
zgu@9728 672 char _pad_before[DEFAULT_CACHE_LINE_SIZE];
ysr@976 673 int _offered_termination;
zgu@9728 674 char _pad_after[DEFAULT_CACHE_LINE_SIZE];
duke@435 675
jmasa@981 676 #ifdef TRACESPINNING
jmasa@981 677 static uint _total_yields;
jmasa@981 678 static uint _total_spins;
jmasa@981 679 static uint _total_peeks;
jmasa@981 680 #endif
jmasa@981 681
duke@435 682 bool peek_in_queue_set();
duke@435 683 protected:
duke@435 684 virtual void yield();
duke@435 685 void sleep(uint millis);
duke@435 686
duke@435 687 public:
duke@435 688
duke@435 689 // "n_threads" is the number of threads to be terminated. "queue_set" is a
duke@435 690 // queue sets of work queues of other threads.
duke@435 691 ParallelTaskTerminator(int n_threads, TaskQueueSetSuper* queue_set);
duke@435 692
duke@435 693 // The current thread has no work, and is ready to terminate if everyone
duke@435 694 // else is. If returns "true", all threads are terminated. If returns
duke@435 695 // "false", available work has been observed in one of the task queues,
duke@435 696 // so the global task is not complete.
ysr@777 697 bool offer_termination() {
ysr@777 698 return offer_termination(NULL);
ysr@777 699 }
ysr@777 700
jcoomes@1342 701 // As above, but it also terminates if the should_exit_termination()
ysr@777 702 // method of the terminator parameter returns true. If terminator is
ysr@777 703 // NULL, then it is ignored.
ysr@777 704 bool offer_termination(TerminatorTerminator* terminator);
duke@435 705
duke@435 706 // Reset the terminator, so that it may be reused again.
duke@435 707 // The caller is responsible for ensuring that this is done
duke@435 708 // in an MT-safe manner, once the previous round of use of
duke@435 709 // the terminator is finished.
duke@435 710 void reset_for_reuse();
jmasa@2188 711 // Same as above but the number of parallel threads is set to the
jmasa@2188 712 // given number.
jmasa@2188 713 void reset_for_reuse(int n_threads);
duke@435 714
jmasa@981 715 #ifdef TRACESPINNING
jmasa@981 716 static uint total_yields() { return _total_yields; }
jmasa@981 717 static uint total_spins() { return _total_spins; }
jmasa@981 718 static uint total_peeks() { return _total_peeks; }
jmasa@981 719 static void print_termination_counts();
jmasa@981 720 #endif
duke@435 721 };
duke@435 722
zgu@3900 723 template<class E, MEMFLAGS F, unsigned int N> inline bool
zgu@3900 724 GenericTaskQueue<E, F, N>::push(E t) {
fujie@9138 725 #ifdef MIPS
fujie@415 726 uint localBot = this->get_bottom();
fujie@415 727 #else
ysr@976 728 uint localBot = _bottom;
fujie@415 729 #endif
vladidan@5483 730 assert(localBot < N, "_bottom out of range.");
jcoomes@1342 731 idx_t top = _age.top();
ysr@976 732 uint dirty_n_elems = dirty_size(localBot, top);
jcoomes@1746 733 assert(dirty_n_elems < N, "n_elems out of range.");
duke@435 734 if (dirty_n_elems < max_elems()) {
ccheung@5259 735 // g++ complains if the volatile result of the assignment is
ccheung@5259 736 // unused, so we cast the volatile away. We cannot cast directly
ccheung@5259 737 // to void, because gcc treats that as not using the result of the
ccheung@5259 738 // assignment. However, casting to E& means that we trigger an
ccheung@5259 739 // unused-value warning. So, we cast the E& to void.
ccheung@5259 740 (void) const_cast<E&>(_elems[localBot] = t);
fujie@9138 741 #ifdef MIPS
fujie@415 742 this->set_bottom(increment_index(localBot));
fujie@415 743 #else
bobv@1459 744 OrderAccess::release_store(&_bottom, increment_index(localBot));
fujie@415 745 #endif
jcoomes@2020 746 TASKQUEUE_STATS_ONLY(stats.record_push());
duke@435 747 return true;
duke@435 748 } else {
duke@435 749 return push_slow(t, dirty_n_elems);
duke@435 750 }
duke@435 751 }
duke@435 752
zgu@3900 753 template<class E, MEMFLAGS F, unsigned int N> inline bool
hseigel@5784 754 GenericTaskQueue<E, F, N>::pop_local(volatile E& t) {
fujie@9138 755 #ifdef MIPS
fujie@415 756 uint localBot = this->get_bottom();
fujie@415 757 #else
ysr@976 758 uint localBot = _bottom;
fujie@415 759 #endif
jcoomes@1342 760 // This value cannot be N-1. That can only occur as a result of
duke@435 761 // the assignment to bottom in this method. If it does, this method
jcoomes@1993 762 // resets the size to 0 before the next call (which is sequential,
duke@435 763 // since this is pop_local.)
jcoomes@1342 764 uint dirty_n_elems = dirty_size(localBot, _age.top());
jcoomes@1342 765 assert(dirty_n_elems != N - 1, "Shouldn't be possible...");
duke@435 766 if (dirty_n_elems == 0) return false;
duke@435 767 localBot = decrement_index(localBot);
fujie@9138 768 #ifdef MIPS
fujie@415 769 this->set_bottom(localBot);
fujie@415 770 #else
duke@435 771 _bottom = localBot;
fujie@415 772 #endif
duke@435 773 // This is necessary to prevent any read below from being reordered
duke@435 774 // before the store just above.
duke@435 775 OrderAccess::fence();
ccheung@5259 776 // g++ complains if the volatile result of the assignment is
ccheung@5259 777 // unused, so we cast the volatile away. We cannot cast directly
ccheung@5259 778 // to void, because gcc treats that as not using the result of the
ccheung@5259 779 // assignment. However, casting to E& means that we trigger an
ccheung@5259 780 // unused-value warning. So, we cast the E& to void.
ccheung@5259 781 (void) const_cast<E&>(t = _elems[localBot]);
duke@435 782 // This is a second read of "age"; the "size()" above is the first.
duke@435 783 // If there's still at least one element in the queue, based on the
duke@435 784 // "_bottom" and "age" we've read, then there can be no interference with
duke@435 785 // a "pop_global" operation, and we're done.
jcoomes@1342 786 idx_t tp = _age.top(); // XXX
duke@435 787 if (size(localBot, tp) > 0) {
jcoomes@1342 788 assert(dirty_size(localBot, tp) != N - 1, "sanity");
jcoomes@2020 789 TASKQUEUE_STATS_ONLY(stats.record_pop());
duke@435 790 return true;
duke@435 791 } else {
duke@435 792 // Otherwise, the queue contained exactly one element; we take the slow
duke@435 793 // path.
jiefu@9784 794
jiefu@9784 795 // The barrier is required to prevent reordering the two reads of _age:
jiefu@9784 796 // one is the _age.get() below, and the other is _age.top() above the if-stmt.
jiefu@9784 797 // The algorithm may fail if _age.get() reads an older value than _age.top().
jiefu@9784 798 OrderAccess::loadload();
jcoomes@1342 799 return pop_local_slow(localBot, _age.get());
duke@435 800 }
duke@435 801 }
duke@435 802
zgu@3900 803 typedef GenericTaskQueue<oop, mtGC> OopTaskQueue;
zgu@3900 804 typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
duke@435 805
jcoomes@1746 806 #ifdef _MSC_VER
jcoomes@1746 807 #pragma warning(push)
jcoomes@1746 808 // warning C4522: multiple assignment operators specified
jcoomes@1746 809 #pragma warning(disable:4522)
jcoomes@1746 810 #endif
coleenp@548 811
coleenp@548 812 // This is a container class for either an oop* or a narrowOop*.
coleenp@548 813 // Both are pushed onto a task queue and the consumer will test is_narrow()
coleenp@548 814 // to determine which should be processed.
coleenp@548 815 class StarTask {
coleenp@548 816 void* _holder; // either union oop* or narrowOop*
jcoomes@1746 817
jcoomes@1746 818 enum { COMPRESSED_OOP_MASK = 1 };
jcoomes@1746 819
coleenp@548 820 public:
ysr@1280 821 StarTask(narrowOop* p) {
ysr@1280 822 assert(((uintptr_t)p & COMPRESSED_OOP_MASK) == 0, "Information loss!");
ysr@1280 823 _holder = (void *)((uintptr_t)p | COMPRESSED_OOP_MASK);
ysr@1280 824 }
ysr@1280 825 StarTask(oop* p) {
ysr@1280 826 assert(((uintptr_t)p & COMPRESSED_OOP_MASK) == 0, "Information loss!");
ysr@1280 827 _holder = (void*)p;
ysr@1280 828 }
coleenp@548 829 StarTask() { _holder = NULL; }
coleenp@548 830 operator oop*() { return (oop*)_holder; }
coleenp@548 831 operator narrowOop*() {
coleenp@548 832 return (narrowOop*)((uintptr_t)_holder & ~COMPRESSED_OOP_MASK);
coleenp@548 833 }
coleenp@548 834
jcoomes@1746 835 StarTask& operator=(const StarTask& t) {
jcoomes@1746 836 _holder = t._holder;
jcoomes@1746 837 return *this;
jcoomes@1746 838 }
jcoomes@1746 839 volatile StarTask& operator=(const volatile StarTask& t) volatile {
jcoomes@1746 840 _holder = t._holder;
jcoomes@1746 841 return *this;
jcoomes@1746 842 }
coleenp@548 843
coleenp@548 844 bool is_narrow() const {
coleenp@548 845 return (((uintptr_t)_holder & COMPRESSED_OOP_MASK) != 0);
coleenp@548 846 }
coleenp@548 847 };
coleenp@548 848
jcoomes@1746 849 class ObjArrayTask
jcoomes@1746 850 {
jcoomes@1746 851 public:
jcoomes@1746 852 ObjArrayTask(oop o = NULL, int idx = 0): _obj(o), _index(idx) { }
jcoomes@1746 853 ObjArrayTask(oop o, size_t idx): _obj(o), _index(int(idx)) {
jcoomes@1746 854 assert(idx <= size_t(max_jint), "too big");
jcoomes@1746 855 }
jcoomes@1746 856 ObjArrayTask(const ObjArrayTask& t): _obj(t._obj), _index(t._index) { }
jcoomes@1746 857
jcoomes@1746 858 ObjArrayTask& operator =(const ObjArrayTask& t) {
jcoomes@1746 859 _obj = t._obj;
jcoomes@1746 860 _index = t._index;
jcoomes@1746 861 return *this;
jcoomes@1746 862 }
jcoomes@1746 863 volatile ObjArrayTask&
jcoomes@1746 864 operator =(const volatile ObjArrayTask& t) volatile {
hseigel@5784 865 (void)const_cast<oop&>(_obj = t._obj);
jcoomes@1746 866 _index = t._index;
jcoomes@1746 867 return *this;
jcoomes@1746 868 }
jcoomes@1746 869
jcoomes@1746 870 inline oop obj() const { return _obj; }
jcoomes@1746 871 inline int index() const { return _index; }
jcoomes@1746 872
jcoomes@1746 873 DEBUG_ONLY(bool is_valid() const); // Tasks to be pushed/popped must be valid.
jcoomes@1746 874
jcoomes@1746 875 private:
jcoomes@1746 876 oop _obj;
jcoomes@1746 877 int _index;
jcoomes@1746 878 };
jcoomes@1746 879
jcoomes@1746 880 #ifdef _MSC_VER
jcoomes@1746 881 #pragma warning(pop)
jcoomes@1746 882 #endif
jcoomes@1746 883
zgu@3900 884 typedef OverflowTaskQueue<StarTask, mtClass> OopStarTaskQueue;
zgu@3900 885 typedef GenericTaskQueueSet<OopStarTaskQueue, mtClass> OopStarTaskQueueSet;
duke@435 886
zgu@3900 887 typedef OverflowTaskQueue<size_t, mtInternal> RegionTaskQueue;
zgu@3900 888 typedef GenericTaskQueueSet<RegionTaskQueue, mtClass> RegionTaskQueueSet;
jmasa@2188 889
stefank@2314 890
stefank@2314 891 #endif // SHARE_VM_UTILITIES_TASKQUEUE_HPP

mercurial