top | item 33070786

(no title)

tipsee | 3 years ago

If you run this on JDK19 with *--enable-preview*, Javalin will use Virtual Threads for the Server ThreadPool (as well as all other ThreadPools it has).

discuss

order

daveidol|3 years ago

How does it compare to coroutines in Kotlin?

tipsee|3 years ago

I mean, it sort of doesn't? Coroutines is a whole concept, Virtual Threads can in most cases just replace java.lang.Threads, which is how it's implemented in Javalin. We just swap out the OS Threads for Virtual Threads.

stefs|3 years ago

i'd be interested in this too. my guess: virtual threads are slightly more memory efficient and slightly faster, but same ballpark.