Lightweight thread and synchronized

Alan Bateman Alan.Bateman at oracle.com
Tue Oct 29 07:05:58 UTC 2019


On 28/10/2019 22:35, Thomas May wrote:
> It was my understanding that one issue with Fibers was that Object#monitor and the synchronized keyword would block the carrier thread.
>
> With the transition to Lightweight Threads, does that mean this is no longer an issue?  How shielded from the carrier threads will Lightweight threads be?
>
This hasn't changed. If a lightweight thread blocks on monitorenter or 
Object::wait then it will pin the underlying carrier thread. We want 
that limitation to go away eventually, it's just not something that will 
happen in the short term.

-Alan


More information about the loom-dev mailing list