1 /*
2 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
27
28 #include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
29 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
30 #include "gc_implementation/parallelScavenge/psTasks.hpp"
31
32
33 // Tasks for parallel compaction of the old generation
34 //
35 // Tasks are created and enqueued on a task queue. The
36 // tasks for parallel old collector for marking objects
37 // are MarkFromRootsTask and ThreadRootsMarkingTask.
38 //
39 // MarkFromRootsTask's are created
40 // with a root group (e.g., jni_handles) and when the do_it()
41 // method of a MarkFromRootsTask is executed, it starts marking
42 // form it's root group.
43 //
44 // ThreadRootsMarkingTask's are created for each Java thread. When
45 // the do_it() method of a ThreadRootsMarkingTask is executed, it
46 // starts marking from the thread's roots.
47 //
48 // The enqueueing of the MarkFromRootsTask and ThreadRootsMarkingTask
49 // do little more than create the task and put it on a queue. The
50 // queue is a GCTaskQueue and threads steal tasks from this GCTaskQueue.
240 //
241 // This task processes regions that have been added to the stacks of each
242 // compaction manager.
243 //
244 // Trying to use one draining thread does not work because there are no
245 // guarantees about which task will be picked up by which thread. For example,
246 // if thread A gets all the preloaded regions, thread A may not get a draining
247 // task (they may all be done by other threads).
248 //
249
250 class DrainStacksCompactionTask : public GCTask {
251 uint _stack_index;
252 uint stack_index() { return _stack_index; }
253 public:
254 DrainStacksCompactionTask(uint stack_index) : GCTask(),
255 _stack_index(stack_index) {};
256 char* name() { return (char *)"drain-region-task"; }
257 virtual void do_it(GCTaskManager* manager, uint which);
258 };
259
260 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
|
1 /*
2 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_PARALLEL_PCTASKS_HPP
26 #define SHARE_VM_GC_PARALLEL_PCTASKS_HPP
27
28 #include "gc/parallel/gcTaskManager.hpp"
29 #include "gc/parallel/psParallelCompact.hpp"
30 #include "gc/parallel/psTasks.hpp"
31
32
33 // Tasks for parallel compaction of the old generation
34 //
35 // Tasks are created and enqueued on a task queue. The
36 // tasks for parallel old collector for marking objects
37 // are MarkFromRootsTask and ThreadRootsMarkingTask.
38 //
39 // MarkFromRootsTask's are created
40 // with a root group (e.g., jni_handles) and when the do_it()
41 // method of a MarkFromRootsTask is executed, it starts marking
42 // form it's root group.
43 //
44 // ThreadRootsMarkingTask's are created for each Java thread. When
45 // the do_it() method of a ThreadRootsMarkingTask is executed, it
46 // starts marking from the thread's roots.
47 //
48 // The enqueueing of the MarkFromRootsTask and ThreadRootsMarkingTask
49 // do little more than create the task and put it on a queue. The
50 // queue is a GCTaskQueue and threads steal tasks from this GCTaskQueue.
240 //
241 // This task processes regions that have been added to the stacks of each
242 // compaction manager.
243 //
244 // Trying to use one draining thread does not work because there are no
245 // guarantees about which task will be picked up by which thread. For example,
246 // if thread A gets all the preloaded regions, thread A may not get a draining
247 // task (they may all be done by other threads).
248 //
249
250 class DrainStacksCompactionTask : public GCTask {
251 uint _stack_index;
252 uint stack_index() { return _stack_index; }
253 public:
254 DrainStacksCompactionTask(uint stack_index) : GCTask(),
255 _stack_index(stack_index) {};
256 char* name() { return (char *)"drain-region-task"; }
257 virtual void do_it(GCTaskManager* manager, uint which);
258 };
259
260 #endif // SHARE_VM_GC_PARALLEL_PCTASKS_HPP
|