< prev index next >

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

Print this page




 165   virtual AbstractGangWorker* allocate_worker(uint which) = 0;
 166 };
 167 
 168 // An class representing a gang of workers.
 169 class WorkGang: public AbstractWorkGang {
 170   // To get access to the GangTaskDispatcher instance.
 171   friend class GangWorker;
 172 
 173   // Never deleted.
 174   ~WorkGang();
 175 
 176   GangTaskDispatcher* const _dispatcher;
 177   GangTaskDispatcher* dispatcher()const {
 178     return _dispatcher;
 179   }
 180 
 181 public:
 182   WorkGang(const char* name,
 183            uint workers,
 184            bool are_GC_task_threads,
 185            bool are_ConcurrentGC_threads);

 186 
 187   // Run a task, returns when the task is done.
 188   virtual void run_task(AbstractGangTask* task);
 189 
 190 protected:
 191   virtual AbstractGangWorker* allocate_worker(uint which);
 192 
 193 private:
 194   void print_worker_started_task(AbstractGangTask* task, uint worker_id);
 195   void print_worker_finished_task(AbstractGangTask* task, uint worker_id);
 196 };
 197 
 198 // Several instances of this class run in parallel as workers for a gang.
 199 class AbstractGangWorker: public WorkerThread {
 200 public:
 201   AbstractGangWorker(AbstractWorkGang* gang, uint id);
 202 
 203   // The only real method: run a task for the gang.
 204   virtual void run();
 205   // Predicate for Thread




 165   virtual AbstractGangWorker* allocate_worker(uint which) = 0;
 166 };
 167 
 168 // An class representing a gang of workers.
 169 class WorkGang: public AbstractWorkGang {
 170   // To get access to the GangTaskDispatcher instance.
 171   friend class GangWorker;
 172 
 173   // Never deleted.
 174   ~WorkGang();
 175 
 176   GangTaskDispatcher* const _dispatcher;
 177   GangTaskDispatcher* dispatcher()const {
 178     return _dispatcher;
 179   }
 180 
 181 public:
 182   WorkGang(const char* name,
 183            uint workers,
 184            bool are_GC_task_threads,
 185            bool are_ConcurrentGC_threads,
 186            GangTaskDispatcher* dispatcher = NULL);
 187 
 188   // Run a task, returns when the task is done.
 189   virtual void run_task(AbstractGangTask* task);
 190 
 191 protected:
 192   virtual AbstractGangWorker* allocate_worker(uint which);
 193 
 194 private:
 195   void print_worker_started_task(AbstractGangTask* task, uint worker_id);
 196   void print_worker_finished_task(AbstractGangTask* task, uint worker_id);
 197 };
 198 
 199 // Several instances of this class run in parallel as workers for a gang.
 200 class AbstractGangWorker: public WorkerThread {
 201 public:
 202   AbstractGangWorker(AbstractWorkGang* gang, uint id);
 203 
 204   // The only real method: run a task for the gang.
 205   virtual void run();
 206   // Predicate for Thread


< prev index next >