hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp
author xdono
Mon, 15 Dec 2008 16:55:11 -0800
changeset 1623 a0dd9009e992
parent 1407 9006b01ba3fd
child 3908 24b55ad4c228
permissions -rw-r--r--
6785258: Update copyright year Summary: Update copyright for files that have been modified starting July 2008 to Dec 2008 Reviewed-by: katleman, ohair, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
1623
a0dd9009e992 6785258: Update copyright year
xdono
parents: 1407
diff changeset
     2
 * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
// Tasks for parallel compaction of the old generation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
// Tasks are created and enqueued on a task queue. The
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
// tasks for parallel old collector for marking objects
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
// are MarkFromRootsTask and ThreadRootsMarkingTask.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// MarkFromRootsTask's are created
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// with a root group (e.g., jni_handles) and when the do_it()
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// method of a MarkFromRootsTask is executed, it starts marking
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// form it's root group.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// ThreadRootsMarkingTask's are created for each Java thread.  When
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// the do_it() method of a ThreadRootsMarkingTask is executed, it
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// starts marking from the thread's roots.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// The enqueuing of the MarkFromRootsTask and ThreadRootsMarkingTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// do little more than create the task and put it on a queue.  The
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
// queue is a GCTaskQueue and threads steal tasks from this GCTaskQueue.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
// In addition to the MarkFromRootsTask and ThreadRootsMarkingTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
// tasks there are StealMarkingTask tasks.  The StealMarkingTask's
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
// steal a reference from the marking stack of another
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
// thread and transitively marks the object of the reference
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
// and internal references.  After successfully stealing a reference
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
// and marking it, the StealMarkingTask drains its marking stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
// stack before attempting another steal.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
// ThreadRootsMarkingTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
// This task marks from the roots of a single thread. This task
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
// enables marking of thread roots in parallel.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
class ParallelTaskTerminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
class ThreadRootsMarkingTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  JavaThread* _java_thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  VMThread* _vm_thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  ThreadRootsMarkingTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  ThreadRootsMarkingTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  char* name() { return (char *)"thread-roots-marking-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
// MarkFromRootsTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
// This task marks from all the roots to all live
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
// objects.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
class MarkFromRootsTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  enum RootType {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    universe              = 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
    jni_handles           = 2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
    threads               = 3,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    object_synchronizer   = 4,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
    flat_profiler         = 5,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
    management            = 6,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
    jvmti                 = 7,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
    system_dictionary     = 8,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    vm_symbols            = 9,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    reference_processing  = 10
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  RootType _root_type;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  MarkFromRootsTask(RootType value) : _root_type(value) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  char* name() { return (char *)"mark-from-roots-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
// RefProcTaskProxy
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
// This task is used as a proxy to parallel reference processing tasks .
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
class RefProcTaskProxy : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  ProcessTask & _rp_task;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  uint          _work_id;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  RefProcTaskProxy(ProcessTask & rp_task, uint work_id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
    : _rp_task(rp_task),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
      _work_id(work_id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  { }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  virtual char* name() { return (char *)"Process referents by policy in parallel"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
// RefEnqueueTaskProxy
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
// This task is used as a proxy to parallel reference processing tasks .
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
class RefEnqueueTaskProxy: public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  EnqueueTask& _enq_task;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  uint         _work_id;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  RefEnqueueTaskProxy(EnqueueTask& enq_task, uint work_id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    : _enq_task(enq_task),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
      _work_id(work_id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  { }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  virtual char* name() { return (char *)"Enqueue reference objects in parallel"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  virtual void do_it(GCTaskManager* manager, uint which)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
    _enq_task.work(_work_id);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
// RefProcTaskExecutor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
// Task executor is an interface for the reference processor to run
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
// tasks using GCTaskManager.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
class RefProcTaskExecutor: public AbstractRefProcTaskExecutor {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  virtual void execute(ProcessTask& task);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  virtual void execute(EnqueueTask& task);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
// StealMarkingTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
// This task is used to distribute work to idle threads.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
class StealMarkingTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
   ParallelTaskTerminator* const _terminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  char* name() { return (char *)"steal-marking-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  StealMarkingTask(ParallelTaskTerminator* t);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  ParallelTaskTerminator* terminator() { return _terminator; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
//
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   191
// StealRegionCompactionTask
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
// This task is used to distribute work to idle threads.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   196
class StealRegionCompactionTask : public GCTask {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
   ParallelTaskTerminator* const _terminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
 public:
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   200
  StealRegionCompactionTask(ParallelTaskTerminator* t);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   202
  char* name() { return (char *)"steal-region-task"; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  ParallelTaskTerminator* terminator() { return _terminator; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
// UpdateDensePrefixTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
// This task is used to update the dense prefix
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
// of a space.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
class UpdateDensePrefixTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  PSParallelCompact::SpaceId _space_id;
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   218
  size_t _region_index_start;
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   219
  size_t _region_index_end;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  char* name() { return (char *)"update-dense_prefix-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
  UpdateDensePrefixTask(PSParallelCompact::SpaceId space_id,
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   225
                        size_t region_index_start,
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   226
                        size_t region_index_end);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
// DrainStacksCompactionTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
//
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   234
// This task processes regions that have been added to the stacks of each
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
// compaction manager.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
// Trying to use one draining thread does not work because there are no
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
// guarantees about which task will be picked up by which thread.  For example,
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   239
// if thread A gets all the preloaded regions, thread A may not get a draining
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
// task (they may all be done by other threads).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
class DrainStacksCompactionTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
 public:
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   245
  char* name() { return (char *)"drain-region-task"; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
};