src/share/vm/utilities/taskqueue.hpp

changeset 2188
8b10f48633dc
parent 2064
5f429ee79634
child 2191
894b1d7c7e01
     1.1 --- a/src/share/vm/utilities/taskqueue.hpp	Thu Sep 16 13:45:55 2010 -0700
     1.2 +++ b/src/share/vm/utilities/taskqueue.hpp	Mon Sep 20 14:38:38 2010 -0700
     1.3 @@ -305,6 +305,12 @@
     1.4    return false;
     1.5  }
     1.6  
     1.7 +// pop_local_slow() is done by the owning thread and is trying to
     1.8 +// get the last task in the queue.  It will compete with pop_global()
     1.9 +// that will be used by other threads.  The tag age is incremented
    1.10 +// whenever the queue goes empty which it will do here if this thread
    1.11 +// gets the last task or in pop_global() if the queue wraps (top == 0
    1.12 +// and pop_global() succeeds, see pop_global()).
    1.13  template<class E, unsigned int N>
    1.14  bool GenericTaskQueue<E, N>::pop_local_slow(uint localBot, Age oldAge) {
    1.15    // This queue was observed to contain exactly one element; either this
    1.16 @@ -637,6 +643,9 @@
    1.17    // in an MT-safe manner, once the previous round of use of
    1.18    // the terminator is finished.
    1.19    void reset_for_reuse();
    1.20 +  // Same as above but the number of parallel threads is set to the
    1.21 +  // given number.
    1.22 +  void reset_for_reuse(int n_threads);
    1.23  
    1.24  #ifdef TRACESPINNING
    1.25    static uint total_yields() { return _total_yields; }
    1.26 @@ -782,3 +791,4 @@
    1.27  
    1.28  typedef OverflowTaskQueue<size_t>             RegionTaskQueue;
    1.29  typedef GenericTaskQueueSet<RegionTaskQueue>  RegionTaskQueueSet;
    1.30 +

mercurial