[External] : Re: Experience using virtual threads in EA 23-loom+4-102
Ron Pressler
ron.pressler at oracle.com
Wed Jul 3 15:51:51 UTC 2024
> On 29 Jun 2024, at 19:04, robert engels <robaho at icloud.com> wrote:
>
> I think the issue is for cpu bound work land - eg image conversions, etc. I think not having time sharing is only an issue for machines with low cpu counts. The issue is that tail latency gets out of control.
Latency is not generally improved by time sharing regardless of the number of CPUs. In some situations time sharing will make it (potentially much) better, and in others it will make it (potentially much) worse. For example, if you start many threads doing the *same* heavy computation on platform threads and compare that to virtual threads you’ll see that the virtual thread latencies will be much better than the platform thread latencies. If the computation done on the different threads is very different in its duration you’ll see the exact opposite occur.
> IO tasks get blocked too easily. Every general workload OS has time sharing (that I’m aware of) has time sharing just for this reason.
IO preempts threads both in the OS and with the virtual thread scheduler even without time sharing. The reason non-realtime OSes have time sharing is different, and has nothing to do with performance (realtime kernels is a different matter). The main reason for time sharing is to keep the machine responsive when it’s at 100% CPU to allow operator interaction, but this is already the case with virtual threads by virtue of the fact that they’re mapped to OS threads.
— Ron
More information about the loom-dev
mailing list