Jetty and Loom
Greg Wilkins
gregw at webtide.com
Tue Jan 5 13:56:05 UTC 2021
Ron,
On Tue, 5 Jan 2021 at 13:19, Ron Pressler <ron.pressler at oracle.com> wrote:
> If the listener might think it means that virtual
> threads somehow *harm* the execution of CPU bound tasks, then it’s
> misleading.
>
I've demonstrated
<https://github.com/webtide/loom-trial/blob/main/src/main/java/org/webtide/loom/CPUBound.java>
that
using virtual threads can defer CPU bound tasks
I've demonstrated <https://webtide.com/do-looms-claims-stack-up-part-2/>
that using virtual threads can double the CPU usage over pool kernel
threads. Even their best usage in my tests has a 4% CPU usage increase.
> The “additional load on GC” statement is not, I believe, demonstrated.
I've demonstrated <https://webtide.com/do-looms-claims-stack-up-part-1/> 1.5s
GC pauses when using virtual threads at levels that kernel threads handle
without pause.
Besides, isn't it self evident that moving stacks from static kernel memory
to dynamic heap is going to have additional GC load? You've even
described how recycling virtual threads will not help reduce that
additional load on the GC as a reason not to pool virtual threads!
It is tautologically true that if your use case does not benefit from
> virtual
> threads then it does not benefit from virtual threads.
Indeed, but half the time it is not clear that you acknowledge that there
are use cases that are not suitable for virtual threads. Just paragraphs
above you are implying that there is "no *harm*" to use virtual threads for
CPU Bound tasks!
> > Totally confused by the messaging from this project.
> I’m confused by what you find confusing.
>
This is not just a hive mind issue as the messaging just from you is
inconsistent. One moment you are happy to describe limitations of virtual
threads and agree that there are use cases that do benefit. Then the next
moment we are back to "what limitations", "no harm" , "not demonstrated"
etc..
None of my demonstrations are fatal flaws. Some may well be fixable, whilst
others are just things to note when making a thread choice. But to deny
them just encourages dwelling on the negatives rather than the positives!
cheers
--
Greg Wilkins <gregw at webtide.com> CTO http://webtide.com
More information about the loom-dev
mailing list