< prev index next >

src/hotspot/share/gc/z/zWorkers.cpp

Print this page




  72       ml.notify_all();
  73     } else {
  74       while (_started != _nworkers) {
  75         ml.wait(Monitor::_no_safepoint_check_flag);
  76       }
  77     }
  78   }
  79 };
  80 
  81 ZWorkers::ZWorkers() :
  82     _boost(false),
  83     _workers("ZWorker",
  84              nworkers(),
  85              true /* are_GC_task_threads */,
  86              true /* are_ConcurrentGC_threads */) {
  87 
  88   log_info(gc, init)("Workers: %u parallel, %u concurrent", nparallel(), nconcurrent());
  89 
  90   // Initialize worker threads
  91   _workers.initialize_workers();




  92 
  93   // Warm up worker threads by having them execute a dummy task.
  94   // This helps reduce latency in early GC pauses, which otherwise
  95   // would have to take on any warmup costs.
  96   ZWorkersWarmupTask task(nworkers());
  97   run(&task, nworkers());
  98 }
  99 
 100 void ZWorkers::set_boost(bool boost) {
 101   if (boost) {
 102     log_debug(gc)("Boosting workers");
 103   }
 104 
 105   _boost = boost;
 106 }
 107 
 108 void ZWorkers::run(ZTask* task, uint nworkers) {
 109   log_debug(gc, task)("Executing Task: %s, Active Workers: %u", task->name(), nworkers);
 110   _workers.update_active_workers(nworkers);
 111   _workers.run_task(task->gang_task());


  72       ml.notify_all();
  73     } else {
  74       while (_started != _nworkers) {
  75         ml.wait(Monitor::_no_safepoint_check_flag);
  76       }
  77     }
  78   }
  79 };
  80 
  81 ZWorkers::ZWorkers() :
  82     _boost(false),
  83     _workers("ZWorker",
  84              nworkers(),
  85              true /* are_GC_task_threads */,
  86              true /* are_ConcurrentGC_threads */) {
  87 
  88   log_info(gc, init)("Workers: %u parallel, %u concurrent", nparallel(), nconcurrent());
  89 
  90   // Initialize worker threads
  91   _workers.initialize_workers();
  92   _workers.update_active_workers(nworkers());
  93   if (_workers.active_workers() != nworkers()) {
  94     vm_exit_during_initialization("Failed to create ZWorkers");
  95   }
  96 
  97   // Warm up worker threads by having them execute a dummy task.
  98   // This helps reduce latency in early GC pauses, which otherwise
  99   // would have to take on any warmup costs.
 100   ZWorkersWarmupTask task(nworkers());
 101   run(&task, nworkers());
 102 }
 103 
 104 void ZWorkers::set_boost(bool boost) {
 105   if (boost) {
 106     log_debug(gc)("Boosting workers");
 107   }
 108 
 109   _boost = boost;
 110 }
 111 
 112 void ZWorkers::run(ZTask* task, uint nworkers) {
 113   log_debug(gc, task)("Executing Task: %s, Active Workers: %u", task->name(), nworkers);
 114   _workers.update_active_workers(nworkers);
 115   _workers.run_task(task->gang_task());
< prev index next >