Implementation of IO with Panama

Pedro Lamarão pedro.lamarao at prodist.com.br
Tue May 18 18:05:26 UTC 2021


Hi all,
The following is a repository with my experiments using the foreign linker.
It is up to date with a recent build from panama-jextract.
Included is an implementation for asynchronous sockets using overlapped I/O
and completion ports.
https://github.com/pedrolamarao/sandbox-jvm-foreign
The most interesting test is a pressure test for asynchronous accept /
connect.
Atte.
Pedro.

Em seg., 19 de abr. de 2021 às 10:37, Pedro Lamarão <
pedro.lamarao at prodist.com.br> escreveu:

> Rado,
> thanks for this interesting work!
> It has inspired me to push my own incomplete experiments with NIO for
> Windows.
> I have just pushed it to github for your consideration.
> win32 = https://github.com/pedrolamarao/sandbox-jvm-windows
> nio = https://github.com/pedrolamarao/sandbox-jvm-windows-nio
> I hope you will find them useful!
> I'm waiting for an opportunity to update them to the new FMA API.
> Atte.
> Pedro.
>
>
> Em qui., 15 de abr. de 2021 às 20:40, Radosław Smogura <mail at smogura.eu>
> escreveu:
>
>> Hi all,
>>
>> I hope you have a good day.
>>
>> I started implementing I/O for JDK using Panama (I could not find such
>> project). I think this is natural consequence of Panama project.
>>
>> Right now, it's done as separate Maven project, which can be found here
>> https://github.com/rsmogura/panama-io
>>
>> Generally, I'm happy it went so smooth.
>>
>> Well done!
>>
>> I created CachedAllocator (first version) which will keep memory segments
>> cached to avoid calling alloc / free (I did not make performance tests
>> between both versions).
>>
>> I created as well simple benchmarks
>> Benchmark                          Mode  Cnt        Score        Error
>> Units
>> SocketReadJdk.teatRead4k          thrpt   15  1202109.549 ± 127132.855
>> ops/s
>> SocketReadJdk.testRead16b         thrpt   15  2818334.225 ±  82209.971
>> ops/s
>> SocketReadJdk.testRead8bOffset    thrpt   15  2851310.595 ±  20675.631
>> ops/s
>> SocketReadPosix.teatRead4k        thrpt   15  1187974.868 ± 101285.497
>> ops/s
>> SocketReadPosix.testRead16b       thrpt   15  2963827.190 ±  62004.165
>> ops/s
>> SocketReadPosix.testRead8bOffset  thrpt   15  2999631.814 ±  23925.859
>> ops/s
>>
>> From minor things and ideas:
>>
>>   *   I could not capture errno using jextract, my script uses
>> --include-var errno, but I had ask for this symbol manually
>>   *   Privately I wonder about safety of errno, as between call to Posix
>> function and reading value we have JVM, which can meantime invoke Posix
>> methods too and make errno dirty (low probability I think)
>>   *   I wonder if we could add class LocalSegmentAllocator which will
>> allocate memory segment on stack (I know there are some risks)
>>
>> If you have any questions, or ideas I'm happy to answer.
>>
>> and I think with moving forward I can provide quite interesting feedback.
>>
>> The goal is to make complete rewrite, together with mmap, and async I/O.
>>
>> Best regards,
>> Rado
>>
>
>
> --
> 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.
>


-- 
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