hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp

Print this page
rev 611 : Merge
   1 #ifdef USE_PRAGMA_IDENT_SRC
   2 #pragma ident "@(#)pcTasks.hpp  1.19 07/05/05 17:05:26 JVM"
   3 #endif
   4 /*
   5  * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  


 174 //
 175 // This task is used to distribute work to idle threads.
 176 //
 177 
 178 class StealMarkingTask : public GCTask {
 179  private:
 180    ParallelTaskTerminator* const _terminator;
 181  private:
 182 
 183  public:
 184   char* name() { return (char *)"steal-marking-task"; }
 185 
 186   StealMarkingTask(ParallelTaskTerminator* t);
 187 
 188   ParallelTaskTerminator* terminator() { return _terminator; }
 189 
 190   virtual void do_it(GCTaskManager* manager, uint which);
 191 };
 192 
 193 //
 194 // StealChunkCompactionTask
 195 //
 196 // This task is used to distribute work to idle threads.
 197 //
 198 
 199 class StealChunkCompactionTask : public GCTask {
 200  private:
 201    ParallelTaskTerminator* const _terminator;
 202  public:
 203   StealChunkCompactionTask(ParallelTaskTerminator* t);
 204 
 205   char* name() { return (char *)"steal-chunk-task"; }
 206   ParallelTaskTerminator* terminator() { return _terminator; }
 207 
 208   virtual void do_it(GCTaskManager* manager, uint which);
 209 };
 210 
 211 //
 212 // UpdateDensePrefixTask
 213 //
 214 // This task is used to update the dense prefix
 215 // of a space.
 216 //
 217 
 218 class UpdateDensePrefixTask : public GCTask {
 219  private:
 220   PSParallelCompact::SpaceId _space_id;
 221   size_t _chunk_index_start;
 222   size_t _chunk_index_end;
 223 
 224  public:
 225   char* name() { return (char *)"update-dense_prefix-task"; }
 226 
 227   UpdateDensePrefixTask(PSParallelCompact::SpaceId space_id,
 228                         size_t chunk_index_start,
 229                         size_t chunk_index_end); 
 230 
 231   virtual void do_it(GCTaskManager* manager, uint which);
 232 };
 233 
 234 //
 235 // DrainStacksCompactionTask
 236 //
 237 // This task processes chunks that have been added to the stacks of each
 238 // compaction manager.
 239 //
 240 // Trying to use one draining thread does not work because there are no
 241 // guarantees about which task will be picked up by which thread.  For example,
 242 // if thread A gets all the preloaded chunks, thread A may not get a draining
 243 // task (they may all be done by other threads).
 244 // 
 245 
 246 class DrainStacksCompactionTask : public GCTask {
 247  public:
 248   char* name() { return (char *)"drain-chunk-task"; }
 249   virtual void do_it(GCTaskManager* manager, uint which);
 250 };
   1 #ifdef USE_PRAGMA_IDENT_SRC
   2 #pragma ident "@(#)pcTasks.hpp  1.19 07/05/05 17:05:26 JVM"
   3 #endif
   4 /*
   5  * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  


 174 //
 175 // This task is used to distribute work to idle threads.
 176 //
 177 
 178 class StealMarkingTask : public GCTask {
 179  private:
 180    ParallelTaskTerminator* const _terminator;
 181  private:
 182 
 183  public:
 184   char* name() { return (char *)"steal-marking-task"; }
 185 
 186   StealMarkingTask(ParallelTaskTerminator* t);
 187 
 188   ParallelTaskTerminator* terminator() { return _terminator; }
 189 
 190   virtual void do_it(GCTaskManager* manager, uint which);
 191 };
 192 
 193 //
 194 // StealRegionCompactionTask
 195 //
 196 // This task is used to distribute work to idle threads.
 197 //
 198 
 199 class StealRegionCompactionTask : public GCTask {
 200  private:
 201    ParallelTaskTerminator* const _terminator;
 202  public:
 203   StealRegionCompactionTask(ParallelTaskTerminator* t);
 204 
 205   char* name() { return (char *)"steal-region-task"; }
 206   ParallelTaskTerminator* terminator() { return _terminator; }
 207 
 208   virtual void do_it(GCTaskManager* manager, uint which);
 209 };
 210 
 211 //
 212 // UpdateDensePrefixTask
 213 //
 214 // This task is used to update the dense prefix
 215 // of a space.
 216 //
 217 
 218 class UpdateDensePrefixTask : public GCTask {
 219  private:
 220   PSParallelCompact::SpaceId _space_id;
 221   size_t _region_index_start;
 222   size_t _region_index_end;
 223 
 224  public:
 225   char* name() { return (char *)"update-dense_prefix-task"; }
 226 
 227   UpdateDensePrefixTask(PSParallelCompact::SpaceId space_id,
 228                         size_t region_index_start,
 229                         size_t region_index_end);
 230 
 231   virtual void do_it(GCTaskManager* manager, uint which);
 232 };
 233 
 234 //
 235 // DrainStacksCompactionTask
 236 //
 237 // This task processes regions that have been added to the stacks of each
 238 // compaction manager.
 239 //
 240 // Trying to use one draining thread does not work because there are no
 241 // guarantees about which task will be picked up by which thread.  For example,
 242 // if thread A gets all the preloaded regions, thread A may not get a draining
 243 // task (they may all be done by other threads).
 244 // 
 245 
 246 class DrainStacksCompactionTask : public GCTask {
 247  public:
 248   char* name() { return (char *)"drain-region-task"; }
 249   virtual void do_it(GCTaskManager* manager, uint which);
 250 };