RFR: Use timed wait to sleep control thread

earthling-amzn github.com+71722661+earthling-amzn at openjdk.java.net
Wed Apr 7 18:18:45 UTC 2021


On Wed, 7 Apr 2021 17:22:05 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Using a timed `wait` rather than a naked sleep allows the control thread to be more responsive to requests from mutators and the regulator thread to start GC cycles. The sleep time is also changed from `ShenandoahControlIntervalMin` to `ShenandoahControlIntervalMax` to reduce unnecessary polling cycles. We could use a plain `wait`, but the control thread is responsible for periodically sending allocation metrics to the `pacer`.
>
> Oh wait, questions...

I'm not sure we can fix this so easily on mainline. The control thread on mainline needs to periodically evaluate the heuristics. To support the generational changes, heuristic evaluation was moved to a separate thread (so that it can initiate a young collection while the control thread is busy handling an old collection).

-------------

PR: https://git.openjdk.java.net/shenandoah/pull/28


More information about the shenandoah-dev mailing list