src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "incls/_precompiled.incl"
  26 #include "incls/_concurrentG1RefineThread.cpp.incl"






  27 
  28 ConcurrentG1RefineThread::
  29 ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *next,
  30                          int worker_id_offset, int worker_id) :
  31   ConcurrentGCThread(),
  32   _worker_id_offset(worker_id_offset),
  33   _worker_id(worker_id),
  34   _active(false),
  35   _next(next),
  36   _monitor(NULL),
  37   _cg1r(cg1r),
  38   _vtime_accum(0.0)
  39 {
  40 
  41   // Each thread has its own monitor. The i-th thread is responsible for signalling
  42   // to thread i+1 if the number of buffers in the queue exceeds a threashold for this
  43   // thread. Monitors are also used to wake up the threads during termination.
  44   // The 0th worker in notified by mutator threads and has a special monitor.
  45   // The last worker is used for young gen rset size sampling.
  46   if (worker_id > 0) {




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc_implementation/g1/concurrentG1Refine.hpp"
  27 #include "gc_implementation/g1/concurrentG1RefineThread.hpp"
  28 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  29 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
  30 #include "memory/resourceArea.hpp"
  31 #include "runtime/handles.inline.hpp"
  32 #include "runtime/mutexLocker.hpp"
  33 
  34 ConcurrentG1RefineThread::
  35 ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *next,
  36                          int worker_id_offset, int worker_id) :
  37   ConcurrentGCThread(),
  38   _worker_id_offset(worker_id_offset),
  39   _worker_id(worker_id),
  40   _active(false),
  41   _next(next),
  42   _monitor(NULL),
  43   _cg1r(cg1r),
  44   _vtime_accum(0.0)
  45 {
  46 
  47   // Each thread has its own monitor. The i-th thread is responsible for signalling
  48   // to thread i+1 if the number of buffers in the queue exceeds a threashold for this
  49   // thread. Monitors are also used to wake up the threads during termination.
  50   // The 0th worker in notified by mutator threads and has a special monitor.
  51   // The last worker is used for young gen rset size sampling.
  52   if (worker_id > 0) {