RFR: 8307483: New micros for j.u.c.LockSupport [v3]
Aleksey Shipilev
shade at openjdk.org
Wed May 17 10:28:52 UTC 2023
On Tue, 9 May 2023 19:13:42 GMT, Eric Caspole <ecaspole at openjdk.org> wrote:
>> These micros were developed while investigating JDK-8305670 by myself and Sergey Kuksenko. The order of thread creation was important in that bug, so there are 2 JMH for creating sleepers before and after the worker threads.
>
> Eric Caspole has updated the pull request incrementally with one additional commit since the last revision:
>
> Add review comments changes.
Looks okay, with a few remaining nits.
test/micro/org/openjdk/bench/java/util/concurrent/UnparkBenchSleepersAfter.java line 119:
> 117: public void tearDown() {
> 118: for (IdleRunnable it : idleRunnables) {
> 119: it.stop();
Suggestion:
for (IdleRunnable r : idleRunnables) {
r.stop();
test/micro/org/openjdk/bench/java/util/concurrent/UnparkBenchSleepersAfter.java line 125:
> 123:
> 124: public static class IdleRunnable implements Runnable {
> 125: volatile boolean done = false;
Suggestion:
volatile boolean done;
test/micro/org/openjdk/bench/java/util/concurrent/UnparkBenchSleepersBefore.java line 98:
> 96: idleRunnables = new IdleRunnable[idles];
> 97: for(int i = 0; i < idleRunnables.length; i++) {
> 98: new Thread(idleRunnables[i] = new IdleRunnable()).start();
Suggestion:
idleRunnables[i] = new IdleRunnable();
new Thread(idleRunnables[i]).start();
test/micro/org/openjdk/bench/java/util/concurrent/UnparkBenchSleepersBefore.java line 108:
> 106: for(IdleRunnable it : idleRunnables) {
> 107: it.stop();
> 108: }
Suggestion:
for (IdleRunnable r : idleRunnables) {
r.stop();
}
test/micro/org/openjdk/bench/java/util/concurrent/UnparkBenchSleepersBefore.java line 113:
> 111:
> 112: public static class IdleRunnable implements Runnable {
> 113: volatile boolean done = false;
Suggestion:
volatile boolean done;
-------------
Marked as reviewed by shade (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13815#pullrequestreview-1430315922
PR Review Comment: https://git.openjdk.org/jdk/pull/13815#discussion_r1196278779
PR Review Comment: https://git.openjdk.org/jdk/pull/13815#discussion_r1196278589
PR Review Comment: https://git.openjdk.org/jdk/pull/13815#discussion_r1196274218
PR Review Comment: https://git.openjdk.org/jdk/pull/13815#discussion_r1196275475
PR Review Comment: https://git.openjdk.org/jdk/pull/13815#discussion_r1196275669
More information about the core-libs-dev
mailing list