RFR: Better handling of cancelled_gc

Aleksey Shipilev shade at redhat.com
Wed Nov 9 14:32:18 UTC 2016


On 11/09/2016 03:20 PM, Roman Kennke wrote:
> http://cr.openjdk.java.net/~rkennke/cancelgc/webrev.01/

Volatile changes look good.

The loop itself:
  - Make 1000 an experimental option, and read it once before entering
the loop?
  - New code exits the loop on cancelled_concgc, without consulting the
terminator? Can it be that other threads are stuck waiting in terminator
for our quitter to show up?

Suggestion:

  while (true) {
    if (heap->cancelled_concgc()) {
      clear_queue(q);
      while (!terminator->offer_termination());
      return;
    }
    for (uint i = 0; i < 1000; i++) {
      if (!try_queue(q, cl) &&
          !try_draining_an_satb_buffer(q) &&
          !try_to_steal(worker_id, cl, &seed)
          ) {
        if (terminator->offer_termination()) return;
      }
    }
  }

Thanks,
-Aleksey



More information about the shenandoah-dev mailing list