Native methods and virtual threads

Ron Pressler ron.pressler at oracle.com
Fri Jul 14 20:09:00 UTC 2023


Because blocking native calls in Java are not very common (at least outside of the JDK itself) and because using platform threads in Java is easy we have no short-term plan for making very frequent blocking native calls work in perfect harmony with virtual threads in general, nor are we aware of a pressing need for that. When we find significant demand for code that uses blocking native calls extensively and yet still gains significant benefit from the use of virtual threads, we will adjust the matter's priority accordingly.

— Ron

> On 14 Jul 2023, at 20:51, Brian S O'Neill <bronee at gmail.com> wrote:
> 
> What I really meant was, what are some of the ideas being discussed to allow arbitrary native methods to work in harmony with virtual threads. The InetAddressResolver just handles one specific case.
> 
> On 2023-07-14 12:37 PM, Alan Bateman wrote:
>> On 14/07/2023 20:28, Brian S O'Neill wrote:
>>> What are some of the ideas being discussed, other than using io_uring for the JDK file API?
>> Look at JEP 418 as an example, that allows you to deploy an InetAddressResolver that releases the carrier during lookup operations. The JDK built-in implementation smooths over this right now by temporarily increasing parallelism during lookup operations.
>> -Alan



More information about the loom-dev mailing list