< prev index next >

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

Print this page




 135   bool are_GC_task_threads()      const { return _are_GC_task_threads; }
 136   bool are_ConcurrentGC_threads() const { return _are_ConcurrentGC_threads; }
 137 
 138   uint total_workers() const { return _total_workers; }
 139 
 140   virtual uint active_workers() const {
 141     assert(_active_workers <= _total_workers,
 142            "_active_workers: %u > _total_workers: %u", _active_workers, _total_workers);
 143     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
 144            "Unless dynamic should use total workers");
 145     return _active_workers;
 146   }
 147   void set_active_workers(uint v) {
 148     assert(v <= _total_workers,
 149            "Trying to set more workers active than there are");
 150     _active_workers = MIN2(v, _total_workers);
 151     assert(v != 0, "Trying to set active workers to 0");
 152     _active_workers = MAX2(1U, _active_workers);
 153     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
 154            "Unless dynamic should use total workers");
 155     log_info(gc, task)("GC Workers: %d", _active_workers);
 156   }
 157 
 158   // Return the Ith worker.
 159   AbstractGangWorker* worker(uint i) const;
 160 
 161   void threads_do(ThreadClosure* tc) const;
 162 
 163   // Debugging.
 164   const char* name() const { return _name; }
 165 
 166   // Printing
 167   void print_worker_threads_on(outputStream *st) const;
 168   void print_worker_threads() const {
 169     print_worker_threads_on(tty);
 170   }
 171 
 172  protected:
 173   virtual AbstractGangWorker* allocate_worker(uint which) = 0;
 174 };
 175 




 135   bool are_GC_task_threads()      const { return _are_GC_task_threads; }
 136   bool are_ConcurrentGC_threads() const { return _are_ConcurrentGC_threads; }
 137 
 138   uint total_workers() const { return _total_workers; }
 139 
 140   virtual uint active_workers() const {
 141     assert(_active_workers <= _total_workers,
 142            "_active_workers: %u > _total_workers: %u", _active_workers, _total_workers);
 143     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
 144            "Unless dynamic should use total workers");
 145     return _active_workers;
 146   }
 147   void set_active_workers(uint v) {
 148     assert(v <= _total_workers,
 149            "Trying to set more workers active than there are");
 150     _active_workers = MIN2(v, _total_workers);
 151     assert(v != 0, "Trying to set active workers to 0");
 152     _active_workers = MAX2(1U, _active_workers);
 153     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
 154            "Unless dynamic should use total workers");
 155     log_info(gc, task)("GC Workers: using %d out of %d", _active_workers, _total_workers);
 156   }
 157 
 158   // Return the Ith worker.
 159   AbstractGangWorker* worker(uint i) const;
 160 
 161   void threads_do(ThreadClosure* tc) const;
 162 
 163   // Debugging.
 164   const char* name() const { return _name; }
 165 
 166   // Printing
 167   void print_worker_threads_on(outputStream *st) const;
 168   void print_worker_threads() const {
 169     print_worker_threads_on(tty);
 170   }
 171 
 172  protected:
 173   virtual AbstractGangWorker* allocate_worker(uint which) = 0;
 174 };
 175 


< prev index next >