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

Julien Viet julien at julienviet.com
Fri Oct 22 06:10:05 UTC 2021


nice work

On Fri, Oct 22, 2021 at 7:43 AM August Nagro <augustnagro at gmail.com> wrote:
>
> 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
>
> --
> You received this message because you are subscribed to the Google Groups "vertx-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vertx-dev+unsubscribe at googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx-dev/CAHNb0ZNd8mrLG4H8OKr66FUUA8RZJppqTb22O9OfZeHXjdQn2A%40mail.gmail.com.


More information about the loom-dev mailing list