GitHub user LI123456mo added a comment to the discussion: [Q/A][Java SDK 
(Component)] For asynchronous calls, should I use asyncCall or virtual threads?

Here let me try to answer from what I researched on

When you use virtual threads, creating a virtual thread (and the executor to 
manage it) isn't free — it's cheap, way cheaper than a real OS thread, but it's 
not zero. There's a small bit of memory and bookkeeping overhead per virtual 
thread.

Using the AsyncCall() style which dubbo uses, you are being handed back the 
thread by the CompletableFuture, and since dubbo has background threads(netty 
I/O threads) that hands the result once ready, this is completely non-blocking 
and dubbo was implementing this asynchronous style way before virtual thread. 

So choose option asyncCall() which was already doing the same thing even before 
the virtual thread.

@polarisGitHub @zrlw @oxsean @RainYuY did I answered well?

GitHub link: 
https://github.com/apache/dubbo/discussions/16379#discussioncomment-18593977

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to