[External] : Re: Native interop with Virtual Threads

Robert Engels rengels at ix.netcom.com
Mon Jun 26 23:11:11 UTC 2023


Go also locks the carrier thread in this arbitrary native case - and simply spawns a new one if needed.

> On Jun 26, 2023, at 6:02 PM, Ron Pressler <ron.pressler at oracle.com> wrote:
> 
> 
> 
>> On 26 Jun 2023, at 17:45, Danish Nawab <dnawab at outlook.com> wrote:
>> 
>> Thanks Ron. 
>> 
>> What about native code that doesn’t make an upcall but does a blocking operation directly (via OS syscalls or similar)? Are such cases also rare? 
> 
> Yes. But supporting those — even if there was reason to — would have been even harder, as Java has no control or knowledge over what native code does.
> 
>> 
>> What would be the advice if someone is making blocking calls from their downcalls? It might not always be possible to rewrite it in Java. 
> 
> If those operations are both frequent and lengthy, they shouldn’t be done on virtual threads.
> 
> — Ron


More information about the loom-dev mailing list