< prev index next >

src/share/vm/gc/shared/workgroup.hpp

Print this page
rev 11460 : refactor: switch to update_active_threads()


 139   // Initialize workers in the gang.  Return true if initialization succeeded.
 140   void initialize_workers();
 141 
 142   bool are_GC_task_threads()      const { return _are_GC_task_threads; }
 143   bool are_ConcurrentGC_threads() const { return _are_ConcurrentGC_threads; }
 144 
 145   uint total_workers() const { return _total_workers; }
 146 
 147   uint created_workers() const {
 148     return _created_workers;
 149   }
 150 
 151   virtual uint active_workers() const {
 152     assert(_active_workers <= _total_workers,
 153            "_active_workers: %u > _total_workers: %u", _active_workers, _total_workers);
 154     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
 155            "Unless dynamic should use total workers");
 156     return _active_workers;
 157   }
 158 
 159   void set_active_workers(uint v) {
 160     assert(v <= _total_workers,
 161            "Trying to set more workers active than there are");
 162     _active_workers = MIN2(v, _total_workers);
 163     add_workers(false /* exit_on_failure */);
 164     assert(v != 0, "Trying to set active workers to 0");
 165     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
 166            "Unless dynamic should use total workers");
 167     log_info(gc, task)("GC Workers: using %d out of %d", _active_workers, _total_workers);

 168   }
 169 
 170   // Add GC workers as needed.
 171   void add_workers(bool initializing);
 172 
 173   // Add GC workers as needed to reach the specified number of workers.
 174   void add_workers(uint active_workers, bool initializing);
 175 
 176   // Return the Ith worker.
 177   AbstractGangWorker* worker(uint i) const;
 178 
 179   void threads_do(ThreadClosure* tc) const;
 180 
 181   // Create a GC worker and install it into the work gang.
 182   virtual AbstractGangWorker* install_worker(uint which);
 183 
 184   // Debugging.
 185   const char* name() const { return _name; }
 186 
 187   // Printing




 139   // Initialize workers in the gang.  Return true if initialization succeeded.
 140   void initialize_workers();
 141 
 142   bool are_GC_task_threads()      const { return _are_GC_task_threads; }
 143   bool are_ConcurrentGC_threads() const { return _are_ConcurrentGC_threads; }
 144 
 145   uint total_workers() const { return _total_workers; }
 146 
 147   uint created_workers() const {
 148     return _created_workers;
 149   }
 150 
 151   virtual uint active_workers() const {
 152     assert(_active_workers <= _total_workers,
 153            "_active_workers: %u > _total_workers: %u", _active_workers, _total_workers);
 154     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
 155            "Unless dynamic should use total workers");
 156     return _active_workers;
 157   }
 158 
 159   uint update_active_workers(uint v) {
 160     assert(v <= _total_workers,
 161            "Trying to set more workers active than there are");
 162     _active_workers = MIN2(v, _total_workers);
 163     add_workers(false /* exit_on_failure */);
 164     assert(v != 0, "Trying to set active workers to 0");
 165     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
 166            "Unless dynamic should use total workers");
 167     log_info(gc, task)("GC Workers: using %d out of %d", _active_workers, _total_workers);
 168     return _active_workers;
 169   }
 170 
 171   // Add GC workers as needed.
 172   void add_workers(bool initializing);
 173 
 174   // Add GC workers as needed to reach the specified number of workers.
 175   void add_workers(uint active_workers, bool initializing);
 176 
 177   // Return the Ith worker.
 178   AbstractGangWorker* worker(uint i) const;
 179 
 180   void threads_do(ThreadClosure* tc) const;
 181 
 182   // Create a GC worker and install it into the work gang.
 183   virtual AbstractGangWorker* install_worker(uint which);
 184 
 185   // Debugging.
 186   const char* name() const { return _name; }
 187 
 188   // Printing


< prev index next >