Live data from Hacker News

Project Loom: Fibers and Continuations for the Java Virtual Machine

cr.openjdk.java.net

1–10 of 43 posts

Re: Project Loom: Fibers and Continuations for the Java Virtual Machine

#4
There are already many different libraries or approaches to concurrency and parallelism on JVM.

- http://www.baeldung.com/java-completablefuture Promises

- http://vertx.io/ Event Loop

- https://akka.io/ and http://www.paralleluniverse.co/quasar/ Actors

- https://projectreactor.io/ and https://github.com/ReactiveX/RxJava Reactive, event-based

- https://kotlinlang.org/docs/reference/coroutines.html Kotlin coroutines. Something like Project Loom from what I gathered from the article. Can be easily used as lightweight threads, async/await, actors, etc.

- Clojure with its own mix https://purelyfunctional.tv/guide/clojure-concurrency-the-ul...

Re: Project Loom: Fibers and Continuations for the Java Virtual Machine

#5
This is an excellent introduction not only to work being done on the JVM, but on some of the implementation challenges of userspace concurrency/greenthreads and M:N scheduling in general.

The detail, nuance, and humility present in this article give me some hope that pathological misbehavior of other M:N scheduling models (see Bryan Cantrill's rant/paper about this for more info) may be avoided if something like that comes to the JVM. However, the sheer complexity of the existing JVM code, as the authors point out, may present an obstacle to that quality. Figuring out yield points for coroutines across a large java codebase seems like it would be . . . painful, to say the least.

Re: Project Loom: Fibers and Continuations for the Java Virtual Machine

#6
post #4

There are already many different libraries or approaches to concurrency and parallelism on JVM. - http://www.baeldung.com/java-completablefuture Promises - http://vertx.io/ Event Loop - https://akka.io/ and http://www.paralleluniverse.co/quasar/ Actors - https://projectreactor.io/ and https://github.com/ReactiveX/RxJava Reactive, event-based - https://kotlinlang.org/docs/reference/coroutines.html Kotlin coroutines. S…

Actually, Quasar is more than actors - it also implements true, actual fibers/coroutines, using bytecode rewriting (essentially turning each async function into a state machine).

Re: Project Loom: Fibers and Continuations for the Java Virtual Machine

#7
post #4

There are already many different libraries or approaches to concurrency and parallelism on JVM. - http://www.baeldung.com/java-completablefuture Promises - http://vertx.io/ Event Loop - https://akka.io/ and http://www.paralleluniverse.co/quasar/ Actors - https://projectreactor.io/ and https://github.com/ReactiveX/RxJava Reactive, event-based - https://kotlinlang.org/docs/reference/coroutines.html Kotlin coroutines. S…

My understanding of all these projects is that you have to change your style of coding / have more complex APIs, or they're just syntactic sugar over heavyweight threads.

What loom seems to offer is the best of both worlds; going back to writing simpler code (e.g. regular "blocking" io code) while scaling much better.

Re: Project Loom: Fibers and Continuations for the Java Virtual Machine

#8
I skimmed the article but this seems heavily influenced by Quasar http://docs.paralleluniverse.co/quasar/ but doesn't make any mention of it.

I have some experience with it and I found it to be a very well designed and documented API. I hope to see it in the JVM someday.

The person behind it is pretty active online and does some other interesting things (the TLA+ subreddit), not sure if they are an hn reader but I hope they chime in here.

Post reply on HN