hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
void PSRefProcTaskExecutor::execute(ProcessTask& task)
{
{- -------------------------------------------
(1) GCTaskQueue::create() で GCTaskQueue を作り,
そこに ParallelGCThreads 個分だけ PSRefProcTaskProxy をつめる.
---------------------------------------- -}
GCTaskQueue* q = GCTaskQueue::create();
for(uint i=0; i<ParallelGCThreads; i++) {
q->enqueue(new PSRefProcTaskProxy(task, i));
}
{- -------------------------------------------
(1) さらに, ParallelGCThreads 個分だけ StealTask を追加.
---------------------------------------- -}
ParallelTaskTerminator terminator(
ParallelScavengeHeap::gc_task_manager()->workers(),
(TaskQueueSetSuper*) PSPromotionManager::stack_array_depth());
if (task.marks_oops_alive() && ParallelGCThreads > 1) {
for (uint j=0; j<ParallelGCThreads; j++) {
q->enqueue(new StealTask(&terminator));
}
}
{- -------------------------------------------
(1) GCTaskManager::execute_and_wait() で, GCTaskThread 達に実行させる.
---------------------------------------- -}
ParallelScavengeHeap::gc_task_manager()->execute_and_wait(q);
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.