Concurrency issue with virtual threads

Сергей Цыпанов sergei.tsypanov at yandex.ru
Mon Jul 29 10:09:01 UTC 2024


Hi Alan, and thanks for clarification!

Is there any issue in tracker for this?

Sergey

> On 28/07/2024 13:59, Сергей Цыпанов wrote:
> 
>> :
>>
>> In the file pay attention to these lines:
>>
>> 12 org.apache.http.pool.AbstractConnPool.getPoolEntryBlocking(AbstractConnPool.java:319)
>> 92 org.apache.http.pool.AbstractConnPool.getPoolEntryBlocking(AbstractConnPool.java:391)
> 
> Further up in the stack is AbstractConnPool.get with the synchronized block that is causing the issue here. A limitation right now is that a virtual thread cannot unmount when inside a synchronized statement or method. In this case it seems that all carriers are pinned by virtual threads that are all blocked in the same place. The other short term fix is to this to migrate this code to also use a j.u.concurrent lock.
> 
> There is work under way to remove this limitation. There are EA builds available [1] that we looking for help testing before the changes are proposed for the main line and a future JDK release.
> 
> -Alan
> 
> [1] https://jdk.java.net/loom/


More information about the loom-dev mailing list