[External] : Re: Experience using virtual threads in EA 23-loom+4-102
Ron Pressler
ron.pressler at oracle.com
Thu Jul 4 18:02:29 UTC 2024
> On 3 Jul 2024, at 17:43, Robert Engels <robaho at icloud.com> wrote:
>
> I don't think that is correct - but I could be wrong.
>
> With platform threads the min and max latency in a completely cpu bound scenario should be very close the the average with a completely fair scheduler (when all tasks/threads are submitted at the same time).
>
> Without timesharing, the average will be the same, but the min and max latencies will be far off the average - as the tasks submitted first complete very quickly, and the tasks submitted at the end take a very long time because they need to have all of the tasks before them complete.
Consider 100 tasks, each running for 1 CPU second on a 1 core machine (although it works the same way with any number of cores). With time-sharing, the average (and median) latency would be 100s. Without time sharing the average (and median) latency would be almost half that.
>
> The linux scheduler relies on timeslicing in order to have a “fair” system. I think most Java “server” type applications strive for fairness as well - i.e. long tail latencies in anything are VERY bad (thus the constant fight against long GC pauses - better to amortize those for consistency).
We are familiar with the theory and design of time sharing. The one and only reason that the virtual thread scheduler doesn’t employ it is that we’ve yet to find realistic server workload for which it helpst. If someone brings to our attention some realistic server workloads where it helps, then we’ll have an actual problem we can try solving.
— Ron
More information about the loom-dev
mailing list