It is an honor to watch Jose Paumard presenting...
@panjacek667429 күн бұрын
Virtual threads have been a game changer for our services. Thank you, JDK engineers (and Spring engineers for adopting them in the framework).
@cesar.vasconcelos28 күн бұрын
Mr. Paumard and Mr. Venkat are true legends. Their videos are gold and even experienced Java Developers will learn a lot from these two gurus.
@oqpo-q6c16 күн бұрын
What I love about all this is that they did not follow the hype back then and did not add the async/await. Guys, you are awesome!
@soliveirajr19 күн бұрын
Great talk, very unbiased and fair! Virtual threads are a great addition to the language, without a doubt. However it is worth mentioning that in terms of sheer performance (latency, not throughput), the 20-year old Java NIO with EPoll cannot be beat. A single thread spinning and pinned to an isolated CPU core is the king when it comes to low latency. And because we are talking about a single thread, which is handling many clients, there are no multithreading pitfalls. That means no synchronization, no deadlocks, no thread starvation, no race conditions, no locks, no nothing. Coding is very easy and joyful. That's the model the financial industry (high frequency market makers) has been very successfully using for 20 years now.
@MikeHeath17 күн бұрын
Yes but this is such an incredibly complicated model to build on. This is why we have frameworks like Reactor and Netty to try and make this model usable. In reality, virtual threads do exactly this. When a virtual thread yields, the scheduler either resumes another virtual thread or invokes epoll to see if any IO has completed. It's essentially the same thing but with a much simpler programming model. Virtual threads gives all the same benefits of old school Java NIO but without all the headaches of trying to put all your concurrent operations in a single epoll loop.
@JosePaumard8 сағат бұрын
> Coding is very easy Sorry, I disagree on this one.
@epsig150727 күн бұрын
I am glad virtual threads came along before my company decided to adopt reactive programming. Now we just need to upgrade java and use virtual threads
@cpu133623 күн бұрын
i'm struggling with reactive code left by previous team, you are lucky!
@jp26323 күн бұрын
I miss Rx. So much cleaner
@cod3r133714 күн бұрын
@@jp263 I have to use Rx (JS flavored) every day and like to think I'm reasonably competent at it by now, and I have to say I hate every second of dealing with that crap. I just wish there was something like Virtual Threads in JS ...
@Dominik-K27 күн бұрын
Amazing presentation! Really well made and teaches the real reasons why virtual threads are an improvement very well
@codeZarathustra22 күн бұрын
Great conference Mr. Paumard.
@sjzara28 күн бұрын
Really helpful - I understand the use of virtual threads for the first time. Thanks.
@PietervandenHombergh29 күн бұрын
typo on slide 47. blocking a virtual thread does NOT block the p.threaf.
@MuztabaHasanat-x2p25 күн бұрын
👏
@vietnha199924 күн бұрын
There are some exceptions. E.g synchronzied block
@srki2223 күн бұрын
What a great presentation. Thank you!
@quickruss0528 күн бұрын
What about reactive streams? I still think there is a place for reactive in stream processing IMO.
@capability-snob28 күн бұрын
The reactor allows us to reason locally about concurrent behaviour. If I know statically where my task may be switched out for another, then I know where I need to recheck my assumptions.
@RenannPrado27 күн бұрын
Before I watch the video, I can only answer the title and say: I really hope so.
@中本聪-d9k22 күн бұрын
The great José Paumard!!!
@Talaria.School8 күн бұрын
Thanks champ.
@adrianomoreira29 күн бұрын
truth, I see fear in my coworkers about the reactive Java code I write
@GoodThoughtsWords28 күн бұрын
Jośe is a really GOAT I mean it!
@amiyas2928 күн бұрын
Very Well explained! Thank you!
@daver9429 күн бұрын
Amazing! Thank u 😊
@122mlb29 күн бұрын
José is the GOAT
@TrishulBudanurShivalingappa24 күн бұрын
nice explanation
@cod3r133729 күн бұрын
What about Kotlin Coroutines? Until now they still give you Structured Concurrency, which is the missing part in Loom. But once Loom has that covered too, do Coroutines still buy you anything?
@equeim28 күн бұрын
Well they will exist forever in Android (or at least for a decade after they are implemented in ART). Also it's not clear what's the replacement for streams of values (e.g. Flow) is. I suppose with virtual threads you can use regular blocking queues for that?
@cod3r133717 күн бұрын
@@equeim I think instead of Flows we could just use regular Java Streams (or Kotlin Sequences) that just happen to potentially block the (virtual) thread when computing the next value. At least that seems like an equivalent abstraction to me. Producer/consumer queues can work too, but that feels like a lower abstraction level.
@DanielSimiyu-f9j29 күн бұрын
The abuse of reactive programming will end with structured concurrency
@Franzstick29 күн бұрын
the talks by Jose are always crystal clear! Thanks for sharing them!
@bkoprucu28 күн бұрын
15:33 Modern systems don't allocate 2MB continuous memory for stack per thread. Stack is allocated dynamically. 2MB is reserved from virtual memory for stack, which can be configured, but this won't actually optimize memory usage much, only mapping tables. A thread typically consumes ~64KB initially (without extra stack frames).
@prdoyle28 күн бұрын
Fun fact: OpenJ9 doesn't even allocate all that virtual memory upfront; it can grow the virtual space dynamically.
@bkoprucu28 күн бұрын
@@prdoyleThat explains why Java 8 consumed more memory on my measurements of stack memory usage
@HarmeetSingh001327 күн бұрын
At 22:58 easiest way to explain reactive framework.
21 күн бұрын
29:50 I suffered this for more than a year
@Undergroundoga29 күн бұрын
Virtual threads solve the blocking issue, but not the underlying task parallelization & back-pressures ones. In the data world & GUI worlds, i imagine RX is here to stay.
@rms_640120 күн бұрын
Do you mean because virtual threads put into heap and unblock app thread only if it's well known api blocking call like http call or file open for example?
@avalagum795717 күн бұрын
Do you really write code to utilize the back-pressure feature in a reactive library? If yes, may I see an example? I think that back pressure is a way to push the problem (which is that there's not enough memory/cpu to process data) from this application to another application. For example, application A calls application B for data. If application A uses the back pressure feature to tell app B not to send too much data, then application A doesn't need to have a lot of memory to hold data that hasn't been processed yet and application B is the place to hold the data that application A. So, instead of holding data in application A, you hold data in application B.
@rms_640117 күн бұрын
@@avalagum7957 yes we do, Swing ui +Chromium doing few k data points per second in between and you need to keep ui in sync, where data exchange is a mix of jni, rpc and websockets
@pintzio110 күн бұрын
@@avalagum7957if application B is a MongoDB, you already have the data stored on it. I think the problem is if application B loads all data in memory and sens to A reactively
@Ewig_Luftenglanz29 күн бұрын
I actually enjoy reactive tho. Most of my work has been creating reactive code
@MrKar1829 күн бұрын
Yes but should we be proud of it with callback based ones when java should do it simpler? And our `doOnError` or `onErrorResume` calls on call stack to safeguard I loose track when we debug. This is needed but we shouldn't be proud of workarounds.
@pothinenivenkat28 күн бұрын
Not that much Sure
@laurentbuhler848327 күн бұрын
Fruit Of Loom :D
@unimatrixz3ro22629 күн бұрын
What a nice talk. The only question is "will the scoped values accept a Generic value"? I do think a response for this but i wish someone of the Java team could answer so i can understand the spirit behind the usage of Scope Value in an oficial way of view. Thanks
@PeterVerhas29 күн бұрын
14:43 I think You meant lost threads. Loose means not tight. Also at 46:00
@shannonkohl6829 күн бұрын
Loose can also mean "escaped" as in "my horse got loose". Which works in the context he is using it. But since I'm not familiar what the proper nomenclature is you may be right.
@PeterVerhas29 күн бұрын
@@shannonkohl68 You are right. For me, loose, like a horse or fugitive, also brings the connotation that it does something rogue, uncontrolled. The threads mentioned simply get lost. However, I have only spoken English as a second language for 45 years, and the difference between loose and lost does not lessen the excellent presentation.
@javierflores0929 күн бұрын
No, the term "loose" is used metaphorically, as in if a thread is not "tight" with your system, your system is going to fall apart due that "loose thread"
@quintesse27 күн бұрын
You have to take into account that we're talking about "threads" which has connotations with weaving and cloth. And that context a "loose thread" makes sense, something that is not part of the whole anymore. A "lost thread" on the other hand would be strange concept, it would have to disappear without us knowing where it went.
@cptfwiffo29 күн бұрын
Always sad to see people confusing latency and throughput. If i dont use concurrency, my latency will go up. My throughput for that thread will suffer. However, if i have enough threads, the gains will not be immediately there: any wait time just lets the cpu do a context switch. Yes, these take time but that is not mentioned. Cpu is still completely filled. The problem occurs when we use microservices with marginal cpu use per work package. Then most time will be wait time and we will hit the max threads. But if you dont, no reason to add the complexity of manual concurrancy.
@nicholas146028 күн бұрын
Let's hope so. Reactive is an unusable disaster.
@PeterVerhas29 күн бұрын
Reactive programming is more than Java. It will remain important in micro service architecture and in Java areas where the vthread approach scheduling overhead is too much. For example, using reactive programming you do not move memory between the stack and the heap. It is a very small niche segment, and for most of the programming tasks where you needed to use reactive progrmming in Java to achive the performance vthreads will provide a simpler programming paradigm.
@bkoprucu28 күн бұрын
Virtual thread scheduling does some smart tricks and doesn't actually copy the stack most of the time. Stack size is also usually relatively small. When other Java features related to virtual threads arrive, and when the ecosystem matures, performance difference will all but disappear. Reactive programming will be used maybe for other features of it, like back pressure, or having drivers for some data sources etc.
@AndrewShikhov18 күн бұрын
How happy I am that I use kotlin at my work, coroutines there are 10 years ahead of java can be
@gugolinyo29 күн бұрын
I don't think so.
@YouBetterBeJedi28 күн бұрын
That makes no sense. Reactive Programming has more aspects
@adambickford872029 күн бұрын
This feels like infomercial levels of dishonesty. Stack traces aren't that bad if you don't use the JDK reactivity, which is pretty limited and has a terrible DX as proven by this video. This reactor code: ` var links = getLinks(); var images = getImages(); Mono.zip(images, links) .map(t2 -> page(t2.getT1(), t2.getT2())) .block();` Produces this stack trace when getImages() errors: `boom java.lang.RuntimeException: boom at org.abickford.fp4legacy.domain.Dishonest.getImages(Dishonest.java:26) at org.abickford.fp4legacy.domain.Dishonest.bs(Dishonest.java:14) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at java.base/java.util.ArrayList.forEach(ArrayList.java:1597) at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)` That hardly feels like the intractable monster that was fearmongered in this video. "Loose threads" isn't a thing here either. I counted over a dozen methods to return defaults, call another async primitive, short circuit, propagate, etc on errors (default is the error channel in the subscriber). These toy examples also feel unfair. If you need to do actual traffic shaping and routing, timeouts, recovery, switching, etc, I'd argue a bunch of imperative threading primitives aren't better at all. I'd far prefer a nice declarative functional API over managing locks and latches. In fact, this whole pitch is a false dichotomy as RX can be implemented *with VT*! DGMW, i think VT are really cool! But the real comparison should be things like c# async/await and how VT don't color methods. VT also work with legacy blocking APIs like JPA/hibernate. This is a huge win and a real differentiator in java. Rx is the wrong battle.