[vertx-dev] Async-Await in Vertx with Project Loom

August Nagro augustnagro at gmail.com
Fri Oct 22 05:43:22 UTC 2021


Altan Ozlu made a benchmark in 2019 which looked promising:
https://github.com/altanozlu/NettyFiberBenchmarks . It is a big change
though; more than I could bite off.

I changed my async-await implementation to use Virtual Threads and Locking.
It also uses a custom Executor like Ron suggested, to schedule tasks on the
Event Loop Context. Doing so keeps everything asynchronous but still
single-threaded, the big benefit of using Verticles.

https://github.com/AugustNagro/vertx-async-await

I also made an async-await implementation for CompletionStage and friends:

https://github.com/AugustNagro/java-async-await

- August

On Thu, Oct 21, 2021 at 1:12 AM Alan Bateman <Alan.Bateman at oracle.com>
wrote:

> On 21/10/2021 08:12, August Nagro wrote:
> > :
> >
> > Now my big question is how Virtual Threads fit into the Vertx/Netty
> > event-loop story.
> I don't know if anyone has tried to run the event loop in a virtual
> thread but there has been a few reports of off-loading to virtual
> threads. This is problematic due to Netty's thread local buffer caches
> where a lot of the time is spent initializing and allocating native
> memory. Project Panama Foreign Memory API is looking very good and maybe
> some future version of Netty could build an allocator and buffer pool
> based on that and at the same time play well with virtual threads.
>
> -Alan
>


More information about the loom-dev mailing list