--- old/src/share/vm/utilities/taskqueue.hpp 2013-02-28 17:28:53.801433497 -0800 +++ new/src/share/vm/utilities/taskqueue.hpp 2013-02-28 17:28:53.565585175 -0800 @@ -321,7 +321,7 @@ void GenericTaskQueue::oops_do(OopClosure* f) { // tty->print_cr("START OopTaskQueue::oops_do"); uint iters = size(); - uint index = _bottom; + uint index = OrderAccess::load_acquire(&_bottom); for (uint i = 0; i < iters; ++i) { index = decrement_index(index); // tty->print_cr(" doing entry %d," INTPTR_T " -> " INTPTR_T, @@ -338,7 +338,7 @@ bool GenericTaskQueue::push_slow(E t, uint dirty_n_elems) { if (dirty_n_elems == N - 1) { // Actually means 0, so do the push. - uint localBot = _bottom; + uint localBot = OrderAccess::load_acquire(&_bottom); // g++ complains if the volatile result of the assignment is unused. const_cast(_elems[localBot] = t); OrderAccess::release_store(&_bottom, increment_index(localBot)); @@ -390,7 +390,7 @@ template bool GenericTaskQueue::pop_global(E& t) { Age oldAge = _age.get(); - uint localBot = _bottom; + uint localBot = OrderAccess::load_acquire(&_bottom); uint n_elems = size(localBot, oldAge.top()); if (n_elems == 0) { return false; @@ -633,8 +633,8 @@ template inline bool GenericTaskQueue::push(E t) { - uint localBot = _bottom; - assert((localBot >= 0) && (localBot < N), "_bottom out of range."); + uint localBot = OrderAccess::load_acquire(&_bottom); + assert(localBot < N, "_bottom out of range."); idx_t top = _age.top(); uint dirty_n_elems = dirty_size(localBot, top); assert(dirty_n_elems < N, "n_elems out of range."); @@ -651,7 +651,7 @@ template inline bool GenericTaskQueue::pop_local(E& t) { - uint localBot = _bottom; + uint localBot = OrderAccess::load_acquire(&_bottom); // This value cannot be N-1. That can only occur as a result of // the assignment to bottom in this method. If it does, this method // resets the size to 0 before the next call (which is sequential,