< prev index next >

src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp

Print this page




  48 bool ConcurrentMarkSweepThread::_should_terminate = false;
  49 int  ConcurrentMarkSweepThread::_CMS_flag         = CMS_nil;
  50 
  51 volatile jint ConcurrentMarkSweepThread::_pending_yields      = 0;
  52 
  53 SurrogateLockerThread*
  54      ConcurrentMarkSweepThread::_slt = NULL;
  55 SurrogateLockerThread::SLT_msg_type
  56      ConcurrentMarkSweepThread::_sltBuffer = SurrogateLockerThread::empty;
  57 Monitor*
  58      ConcurrentMarkSweepThread::_sltMonitor = NULL;
  59 
  60 ConcurrentMarkSweepThread::ConcurrentMarkSweepThread(CMSCollector* collector)
  61   : ConcurrentGCThread() {
  62   assert(UseConcMarkSweepGC,  "UseConcMarkSweepGC should be set");
  63   assert(_cmst == NULL, "CMS thread already created");
  64   _cmst = this;
  65   assert(_collector == NULL, "Collector already set");
  66   _collector = collector;
  67 
  68   set_name("Concurrent Mark-Sweep GC Thread");
  69 
  70   if (os::create_thread(this, os::cgc_thread)) {
  71     // An old comment here said: "Priority should be just less
  72     // than that of VMThread".  Since the VMThread runs at
  73     // NearMaxPriority, the old comment was inaccurate, but
  74     // changing the default priority to NearMaxPriority-1
  75     // could change current behavior, so the default of
  76     // NearMaxPriority stays in place.
  77     //
  78     // Note that there's a possibility of the VMThread
  79     // starving if UseCriticalCMSThreadPriority is on.
  80     // That won't happen on Solaris for various reasons,
  81     // but may well happen on non-Solaris platforms.
  82     int native_prio;
  83     if (UseCriticalCMSThreadPriority) {
  84       native_prio = os::java_to_os_priority[CriticalPriority];
  85     } else {
  86       native_prio = os::java_to_os_priority[NearMaxPriority];
  87     }
  88     os::set_native_priority(this, native_prio);




  48 bool ConcurrentMarkSweepThread::_should_terminate = false;
  49 int  ConcurrentMarkSweepThread::_CMS_flag         = CMS_nil;
  50 
  51 volatile jint ConcurrentMarkSweepThread::_pending_yields      = 0;
  52 
  53 SurrogateLockerThread*
  54      ConcurrentMarkSweepThread::_slt = NULL;
  55 SurrogateLockerThread::SLT_msg_type
  56      ConcurrentMarkSweepThread::_sltBuffer = SurrogateLockerThread::empty;
  57 Monitor*
  58      ConcurrentMarkSweepThread::_sltMonitor = NULL;
  59 
  60 ConcurrentMarkSweepThread::ConcurrentMarkSweepThread(CMSCollector* collector)
  61   : ConcurrentGCThread() {
  62   assert(UseConcMarkSweepGC,  "UseConcMarkSweepGC should be set");
  63   assert(_cmst == NULL, "CMS thread already created");
  64   _cmst = this;
  65   assert(_collector == NULL, "Collector already set");
  66   _collector = collector;
  67 
  68   set_name("CMS Main Thread");
  69 
  70   if (os::create_thread(this, os::cgc_thread)) {
  71     // An old comment here said: "Priority should be just less
  72     // than that of VMThread".  Since the VMThread runs at
  73     // NearMaxPriority, the old comment was inaccurate, but
  74     // changing the default priority to NearMaxPriority-1
  75     // could change current behavior, so the default of
  76     // NearMaxPriority stays in place.
  77     //
  78     // Note that there's a possibility of the VMThread
  79     // starving if UseCriticalCMSThreadPriority is on.
  80     // That won't happen on Solaris for various reasons,
  81     // but may well happen on non-Solaris platforms.
  82     int native_prio;
  83     if (UseCriticalCMSThreadPriority) {
  84       native_prio = os::java_to_os_priority[CriticalPriority];
  85     } else {
  86       native_prio = os::java_to_os_priority[NearMaxPriority];
  87     }
  88     os::set_native_priority(this, native_prio);


< prev index next >