Skip to content
Permalink
Browse files
8263832: Shenandoah: Fixing parallel thread iteration in final mark task
Reviewed-by: rkennke
  • Loading branch information
zhengyu123 committed Mar 19, 2021
1 parent 434a399 commit d185655c27fbf84980f2e05c4e29e02a32747178
Showing 1 changed file with 8 additions and 12 deletions.
@@ -96,23 +96,19 @@ class ShenandoahSATBAndRemarkThreadsClosure : public ThreadClosure {
private:
SATBMarkQueueSet& _satb_qset;
OopClosure* const _cl;
uintx _claim_token;

public:
ShenandoahSATBAndRemarkThreadsClosure(SATBMarkQueueSet& satb_qset, OopClosure* cl) :
_satb_qset(satb_qset),
_cl(cl),
_claim_token(Threads::thread_claim_token()) {}
_cl(cl) {}

void do_thread(Thread* thread) {
if (thread->claim_threads_do(true, _claim_token)) {
// Transfer any partial buffer to the qset for completed buffer processing.
_satb_qset.flush_queue(ShenandoahThreadLocalData::satb_mark_queue(thread));
if (thread->is_Java_thread()) {
if (_cl != NULL) {
ResourceMark rm;
thread->oops_do(_cl, NULL);
}
// Transfer any partial buffer to the qset for completed buffer processing.
_satb_qset.flush_queue(ShenandoahThreadLocalData::satb_mark_queue(thread));
if (thread->is_Java_thread()) {
if (_cl != NULL) {
ResourceMark rm;
thread->oops_do(_cl, NULL);
}
}
}
@@ -147,7 +143,7 @@ class ShenandoahFinalMarkingTask : public AbstractGangTask {
ShenandoahMarkRefsClosure mark_cl(q, rp);
ShenandoahSATBAndRemarkThreadsClosure tc(satb_mq_set,
ShenandoahIUBarrier ? &mark_cl : NULL);
Threads::threads_do(&tc);
Threads::possibly_parallel_threads_do(true /*par*/, &tc);
}

_cm->mark_loop(worker_id, _terminator, rp,

0 comments on commit d185655

Please sign in to comment.