< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp

Print this page




  87     set_active(false);
  88   } else {
  89     G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set();
  90     dcqs.set_process_completed_buffers(false);
  91   }
  92 }
  93 
  94 void G1ConcurrentRefineThread::run_service() {
  95   _vtime_start = os::elapsedVTime();
  96 
  97   while (!should_terminate()) {
  98     // Wait for work
  99     wait_for_completed_buffers();
 100     if (should_terminate()) {
 101       break;
 102     }
 103 
 104     size_t buffers_processed = 0;
 105     log_debug(gc, refine)("Activated worker %d, on threshold: " SIZE_FORMAT ", current: " SIZE_FORMAT,
 106                           _worker_id, _cr->activation_threshold(_worker_id),
 107                           G1BarrierSet::dirty_card_queue_set().num_cards());
 108 
 109     {
 110       SuspendibleThreadSetJoiner sts_join;
 111 
 112       while (!should_terminate()) {
 113         if (sts_join.should_yield()) {
 114           sts_join.yield();
 115           continue;             // Re-check for termination after yield delay.
 116         }
 117 
 118         if (!_cr->do_refinement_step(_worker_id)) {
 119           break;
 120         }
 121         ++buffers_processed;
 122       }
 123     }
 124 
 125     deactivate();
 126     log_debug(gc, refine)("Deactivated worker %d, off threshold: " SIZE_FORMAT
 127                           ", current: " SIZE_FORMAT ", buffers processed: "
 128                           SIZE_FORMAT,
 129                           _worker_id, _cr->deactivation_threshold(_worker_id),
 130                           G1BarrierSet::dirty_card_queue_set().num_cards(),
 131                           buffers_processed);
 132 
 133     if (os::supports_vtime()) {
 134       _vtime_accum = (os::elapsedVTime() - _vtime_start);
 135     } else {
 136       _vtime_accum = 0.0;
 137     }
 138   }
 139 
 140   log_debug(gc, refine)("Stopping %d", _worker_id);
 141 }
 142 
 143 void G1ConcurrentRefineThread::stop_service() {
 144   MutexLocker x(_monitor, Mutex::_no_safepoint_check_flag);
 145   _monitor->notify();
 146 }


  87     set_active(false);
  88   } else {
  89     G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set();
  90     dcqs.set_process_completed_buffers(false);
  91   }
  92 }
  93 
  94 void G1ConcurrentRefineThread::run_service() {
  95   _vtime_start = os::elapsedVTime();
  96 
  97   while (!should_terminate()) {
  98     // Wait for work
  99     wait_for_completed_buffers();
 100     if (should_terminate()) {
 101       break;
 102     }
 103 
 104     size_t buffers_processed = 0;
 105     log_debug(gc, refine)("Activated worker %d, on threshold: " SIZE_FORMAT ", current: " SIZE_FORMAT,
 106                           _worker_id, _cr->activation_threshold(_worker_id),
 107                            G1BarrierSet::dirty_card_queue_set().completed_buffers_num());
 108 
 109     {
 110       SuspendibleThreadSetJoiner sts_join;
 111 
 112       while (!should_terminate()) {
 113         if (sts_join.should_yield()) {
 114           sts_join.yield();
 115           continue;             // Re-check for termination after yield delay.
 116         }
 117 
 118         if (!_cr->do_refinement_step(_worker_id)) {
 119           break;
 120         }
 121         ++buffers_processed;
 122       }
 123     }
 124 
 125     deactivate();
 126     log_debug(gc, refine)("Deactivated worker %d, off threshold: " SIZE_FORMAT
 127                           ", current: " SIZE_FORMAT ", processed: " SIZE_FORMAT,

 128                           _worker_id, _cr->deactivation_threshold(_worker_id),
 129                           G1BarrierSet::dirty_card_queue_set().completed_buffers_num(),
 130                           buffers_processed);
 131 
 132     if (os::supports_vtime()) {
 133       _vtime_accum = (os::elapsedVTime() - _vtime_start);
 134     } else {
 135       _vtime_accum = 0.0;
 136     }
 137   }
 138 
 139   log_debug(gc, refine)("Stopping %d", _worker_id);
 140 }
 141 
 142 void G1ConcurrentRefineThread::stop_service() {
 143   MutexLocker x(_monitor, Mutex::_no_safepoint_check_flag);
 144   _monitor->notify();
 145 }
< prev index next >