4 ms·
It's more accurate to say Loom is [a particular type of] continuations in the JVM, which can be used to implement green threads / fibers. You can see the imple
by shellac 4y ago
It's more accurate to say Loom is [a particular type of] continuations in the JVM, which can be used to implement green threads / fibers.
You can see the implementation of VirtualThread here: https://github.com/openjdk/loom/blob/fibers/src/java.base/share/classes/java/lang/VirtualThread.java https://github.com/openjdk/loom/blob/fibers/src/java.base/sh...
This uses the internal 'one-shot delimited continuation': https://github.com/openjdk/loom/blob/fibers/src/java.base/share/classes/jdk/internal/vm/Continuation.java https://github.com/openjdk/loom/blob/fibers/src/java.base/sh...
So, at least in principle, there is scope for other styles of concurrency to be implemented over this.