hotspot/src/share/vm/utilities/taskqueue.hpp
changeset 6759 67b1a69ef5aa
parent 6251 90e562b9f1cc
child 6762 f8d1b560700e
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp	Thu Sep 16 13:45:55 2010 -0700
+++ b/hotspot/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;
+