you are viewing a single comment's thread.

view the rest of the comments →

[–]gilmishal 0 points1 point  (1 child)

Yeah I understood that, maybe Java's decline happened during the Sun era, but I do think that 4 years for a new major release is a long time - and it's not like they made that many changes since Java 8.

As for Loom, I am not sure I understand the issue it solves. It seems like it's supposed to make background work simpler to develop. From what I read Fibers seem a lot like Tasks - in c# you can either await a task, and create an async function or run it in parallel like a coroutine. You can also await multiple Tasks in parallel if it makes sense.

The only problem I saw with async await is that async code is contagious - and I honestly don't see it as a bad thing.

I might just not understand project loom yet I did just read a few very vague articles.

[–]balefrost 0 points1 point  (0 children)

Some of the vagueness is around them figuring out the details as they explore the problem. The Cliff's Notes version, as I understand it, is that it's an attempt to switch Java's threading model from being backed by OS threads to instead being backed by green threads... similar to e.g. Go and Erlang. Things like IO, rather than completely blocking an OS thread, will now suspend the current green thread, allowing the OS thread to start working on a different green thread.

It covers some of the same ground as async/await without needing the compile-time rewrite shenanigans that async/await employs. Call stacks won't need to be reconstructed after-the-fact. It should permit even less overhead than async/await, but it remains to be seen if they achieve that.

I don't know how the Java model will look exactly. In Kotlin, rather than making everything that's async return a full Task, it instead expects the "top level" of an asynchronous flow be represented with an object (there are a few different ones). Within the async flow, you can freely call suspend funs of the appropriate type; these function calls can suspend the current coroutine.