[foreign-memaccess+abi] RFR: Improve NIO channel support for buffer views over segments [v3]

Pedro Lamarão pedro.lamarao at prodist.com.br
Thu Apr 22 14:32:33 UTC 2021


Em qui., 22 de abr. de 2021 às 11:24, Chris Hegarty <chegar at openjdk.java.net>
escreveu:

> On Thu, 22 Apr 2021 11:39:55 GMT, Maurizio Cimadamore <
> mcimadamore at openjdk.org> wrote:
>
> > Crazy idea - are we sure we need this check? If user wants to really
> pass a confined buffer to an async IO, I belive a failure would still occur
> when the segment is accessed by a different thread - do you see reporting
> an error eagerly as something important? Will fibers change things so that
> e.g. we might be able to do more with a _single_ thread?
>
> 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.


-- 
Pedro Lamarão
https://www.prodist.com.br
Securing Critical Systems
Tel: +55 11 4380-6585

Antes de imprimir esta mensagem e seus anexos, certifique-se que seja
realmente necessário.
Proteger o meio ambiente é nosso dever.
Before printing this e-mail or attachments, be sure it is necessary.
It is in our hands to protect the environment.


More information about the panama-dev mailing list