[foreign-memaccess+abi] RFR: Improve NIO channel support for buffer views over segments [v5]
Chris Hegarty
chegar at openjdk.java.net
Thu Apr 22 16:31:36 UTC 2021
On Thu, 22 Apr 2021 15:51:06 GMT, Chris Hegarty <chegar at openjdk.org> wrote:
>> Initial prototype changes to use resource scope handles when performing I/O operations with synchronous and asynchronous channels.
>>
>> Further details can be found at: https://inside.java/2021/01/25/memory-access-pulling-all-the-threads/
>
> Chris Hegarty has updated the pull request incrementally with one additional commit since the last revision:
>
> Additional test fix for Windows
> _Mailing list message from [Pedro Lamarão]...
> Em qui., 22 de abr. de 2021 ?s 11:24, Chris Hegarty <chegar at openjdk.java.net>
> ....
> > I think that there is scope for tweaking this in the future. At the moment
> > with the current structure, the Windows async socket channel implementation
> > will access the memory behind the scope's/segment's back ( through the
> > `long` address value that it retrieves ). It stores and reuses the "naked"
> > address value from a thread other than that of the thread which initialed
> > the I/O operation, all without invoking any memory access operations from
> > Java. It's a non-trivial change to alter this, and not even clear if we
> > should.
>
> Consider also what the Windows API calls "registered I/O", also linux
> "io_uring", which potentially causes this memory to be directly accessed
> way down in the system software architecture. Atte. Pedro.
Correct, it's a detail of the implementation how the memory is ultimately accessed, and when (and for how long) the resource scope handle is acquired. So may vary for different implementations. The Windows asynchronous socket channels in the JDK use Overlapped I/O and registers to receive a notification via an I/O completion port.
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/512
More information about the panama-dev
mailing list