109 //
110 // The idea is that objects representing fine-grained tasks, such as
111 // threads, will contain a "parity" field. A task will is claimed in the
112 // current "process_roots" call only if its parity field is the
113 // same as the "strong_roots_parity"; task claiming is accomplished by
114 // updating the parity field to the strong_roots_parity with a CAS.
115 //
116 // If the client meats this spec, then strong_roots_parity() will have
117 // the following properties:
118 // a) to return a different value than was returned before the last
119 // call to change_strong_roots_parity, and
120 // c) to never return a distinguished value (zero) with which such
121 // task-claiming variables may be initialized, to indicate "never
122 // claimed".
123 public:
124
125 // Call these in sequential code around process_roots.
126 // strong_roots_prologue calls change_strong_roots_parity, if
127 // parallel tasks are enabled.
128 class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope {
129 SharedHeap* _sh;
130
131 public:
132 StrongRootsScope(SharedHeap* heap, bool activate = true);
133 ~StrongRootsScope();
134 };
135 };
136
137 #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP
|
109 //
110 // The idea is that objects representing fine-grained tasks, such as
111 // threads, will contain a "parity" field. A task will is claimed in the
112 // current "process_roots" call only if its parity field is the
113 // same as the "strong_roots_parity"; task claiming is accomplished by
114 // updating the parity field to the strong_roots_parity with a CAS.
115 //
116 // If the client meats this spec, then strong_roots_parity() will have
117 // the following properties:
118 // a) to return a different value than was returned before the last
119 // call to change_strong_roots_parity, and
120 // c) to never return a distinguished value (zero) with which such
121 // task-claiming variables may be initialized, to indicate "never
122 // claimed".
123 public:
124
125 // Call these in sequential code around process_roots.
126 // strong_roots_prologue calls change_strong_roots_parity, if
127 // parallel tasks are enabled.
128 class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope {
129 public:
130 StrongRootsScope(bool activate = true);
131 ~StrongRootsScope();
132 };
133 };
134
135 #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP
|