-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
The Linux implementation of the attach provider makes use of JNI for
among other file permission checks and interacting with Unix domain
sockets. These days Java-based APIs are available that cover these needs
[1] [2]. Besides the direct benefit of reducing JNI usage, moving to
these APIs have the following benefits:
- avoids pinning of virtual threads
- code is easier to understand and maintain as more is in Java files, and
uses well-known Java APIs
- serve as a template for similar improvements on AIX and macOS
- open options for more code sharing between Unix implementations (AIX,
Linux and macOS)
- serve as a basis for ultimately removing JNI from the Linux, and AIX
attach provider entirely
[1] https://jcp.org/en/jsr/detail?id=203
[2] https://openjdk.org/jeps/380
among other file permission checks and interacting with Unix domain
sockets. These days Java-based APIs are available that cover these needs
[1] [2]. Besides the direct benefit of reducing JNI usage, moving to
these APIs have the following benefits:
- avoids pinning of virtual threads
- code is easier to understand and maintain as more is in Java files, and
uses well-known Java APIs
- serve as a template for similar improvements on AIX and macOS
- open options for more code sharing between Unix implementations (AIX,
Linux and macOS)
- serve as a basis for ultimately removing JNI from the Linux, and AIX
attach provider entirely
[1] https://jcp.org/en/jsr/detail?id=203
[2] https://openjdk.org/jeps/380