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