RFR: 8286597: Implement PollerProvider on AIX [v9]

Tyler Steele tsteele at openjdk.org
Fri May 19 15:03:05 UTC 2023


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

>> src/java.base/aix/classes/sun/nio/ch/PollsetPoller.java line 107:
>> 
>>> 105:             polled(fd);
>>> 106:         }
>>> 107:         Pollset.freePollArray(buffer);
>> 
>> If I read this correctly, there is a malloc/free per poll, is that right?
>
> If you look at the Poller implementations on the other platform you'll see that they allocate the poll array at construction time, I think that is what you want here too.

You are correct that there is a malloc/free per poll. I made this decision intentionally.

The other implementations allocate a fixed size array at object creation. This imposes an upper limit on the number of fds that can be polled. I made the decision to move this allocation to the poll call and track the size of the poll set. This way, (1) the only limit to the size of the poll set is the system limit on number of open fds (if you can open an fd it can be polled) (2) there is no wasted space to an arbitrarily large array when there are only a few fds polled.

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

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


More information about the hotspot-dev mailing list