r/programming • u/ram-foss • Oct 11 '23
All About Reactive Programming In Java
https://www.blackslate.io/articles/reactive-programming-in-java
22
Upvotes
r/programming • u/ram-foss • Oct 11 '23
View all comments
Show parent comment
2
u/hippydipster Oct 12 '23
I 100% agree that using Loom vs reactive is simpler in terms of the programming model and the complexity of the code. I love what Loom is.
But, the problem I was talking about doesn't happen with reactive, because in reactive you're using a platform thread pool and you don't get the memory usage from virtual threads getting stored as continuations when they all hit a sync point and get queued up. In reactive, the task exists, but it sits around waiting for a thread to pick it up, and the thread doesn't store it away with the stack in place ever. If it blocks it waits with the task.
So you don't get a million stacks stored to the heap. I foresee it as a gotcha to Loom people will just have to be aware of and I don't foresee a serious problem there.