Concurrency issue with virtual threads
Alan Bateman
alan.bateman at oracle.com
Sun Jul 28 17:30:13 UTC 2024
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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240728/0dbecdd2/attachment.htm>
More information about the loom-dev
mailing list