RFR: 8286597: Implement PollerProvider on AIX [v9]

Tyler Steele tsteele at openjdk.org
Fri May 19 15:07:58 UTC 2023


On Fri, 19 May 2023 09:16:48 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Tyler Steele has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fixup
>>  - Accept @turbanoff's changes
>
> src/java.base/aix/classes/sun/nio/ch/PollsetPoller.java line 90:
> 
>> 88:             default:
>> 89:                 Instant end = Instant.now().plusMillis(timeout);
>> 90:                 do { n = pollInner(100); } while (n == 0 && Instant.now().isBefore(end));
> 
> Now, the Poller uses poll(-1) to poll indefinitely so the 0/default cases aren't used. If we do start to use the timed case then L90 probably should probably be optimized to avoid Instant.now. Also, probably should be reformatted to make the do-while loop a bit easier to read.

I'm happy to tweak this case. In terms of formatting, would you prefer?


do { n = pollInner(100); }
while (n == 0 && Instant.now().isBefore(end));


or the more conventional


do {
  n = pollInner(100);
} while (n == 0 && Instant.now().isBefore(end));


or another idea?

---

In regards to `Instant.now(...)`. I'm not sure I understand your suggestion. Could you please clarify? Is there a different time-object I should use instead?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13452#discussion_r1199071937


More information about the nio-dev mailing list