Project Loom VirtualThreads hang
Alan Bateman
Alan.Bateman at oracle.com
Tue Jan 3 14:34:08 UTC 2023
On 03/01/2023 14:03, Robert Engels wrote:
> :
>
> A virtual thread should be far more efficient in regards to user space
> locking/blocking/wake-up - my tests show only a few % system cpu time.
> To do this well though the vthread scheduler needs to be super
> efficient and the locking constructs rewritten knowing they’re on
> green threads - because the spin time/block decisions are much
> different (eg upwards of 16 microseconds to perform an os switch to
> another thread on the cpu vs a few hundred nanoseconds for a green
> thread switch).
Yes, the cost model is different so the use of spin loops to reduce
parking has to looked at in several places. So what are you testing, is
a j.u.concurrent API or something else? There is some spinning and
yield once in APIs such as SQ and LTQ that do need to be re-examined.
-Alan
More information about the loom-dev
mailing list