Project Loom VirtualThreads hang

Manish G manish.c.ghildiyal at gmail.com
Fri Dec 30 08:48:19 UTC 2022


I may chip in here if any API docs update is needed.

Please let me know.

Manish

On Fri, Dec 30, 2022 at 1:54 PM Alan Bateman <Alan.Bateman at oracle.com>
wrote:

> On 29/12/2022 22:25, robert engels wrote:
> > I also found, Thread.onSpinWait().
> >
> > The default implementation is empty, but I wonder if there should be
> > an implementation for VThreads that functions the same as
> > Thread.yield()...
>
> Thread.onSpinWait is for spin or busy waiting in low-level code, say
> when spinning for some variable to change. It is compiled to a pause
> instruction (or isb or the equivalent for the processor, maybe even a
> nop) so it's measured in CPU cycles. This could be a different order of
> magnitude to a Thread.yield that might be a few hundred nanoseconds in
> the best case and appropriate when there isn't any work to do and useful
> to give up the processor.  This is an area where the API docs could
> provide some guidance.
>
> -Alan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20221230/7ab0527a/attachment.htm>


More information about the loom-dev mailing list