72 ms·
There have been several attempts of porting actors to the JVM. Quasar and Pulsar’s main contribution — from which many of their advantages stem — is true
by rektide 14y ago
There have been several attempts of porting actors to the
JVM. Quasar and Pulsar’s main contribution — from which
many of their advantages stem — is true lightweight
threads[1]. Lightweight threads provide many of the same
benefits “regular”, OS threads do, namely a single, simple
control flow and the ability to block and wait for some
resource to become available while in the meantime
allowing other threads to run on the CPU. Unlike regular
threads, lightweight threads are not scheduled by the
operating system so their context-switch is often faster,
and they require far less system resources. As a result, a
single machine can handle millions of them.
http://blog.paralleluniverse.co/post/49445260575/quasar-pulsar http://blog.paralleluniverse.co/post/49445260575/quasar-puls...
Excellent area to contribute to. In 2006-2008 there was Kilim, which uses some code-rewriting to accomplish similar greenthreading on the JVM to support an actor system with extremely lightweight lock-ree message massing.
Kilim comfortably scales to handle hundreds of thousands of actors
and messages on modest hardware. It is fast as well – task-switching
is 1000x faster than Java threads and 60x faster than other lightweight
tasking frameworks, and message-passing is 3x faster than Erlang (cur-
rently the gold standard for concurrency-oriented programming).
from https://github.com/kilim/kilim/raw/master/docs/kilim_ecoop08.pdf https://github.com/kilim/kilim/raw/master/docs/kilim_ecoop08...
Kilim: https://github.com/kilim/kilim https://github.com/kilim/kilim
- swannodette 14y agofwiw, he did in fact mention Kilim in the footnotes. Sriram also chimes in on the comments.
- rektide 14y agoHis point about Kilim being a monolithic solution is well taken- getting all three of these right (from both the end-user perspective and transformational perspective) is hard! (i) ultra-lightweight, cooperatively-scheduled threads (actors), (ii) a message-passing frame- work (no shared memory, no locks) and (iii) isolation-aware messaging. There's a stackoverflow thread on continuation libraries for the JVM. There's some coverage of the unnamed coroutine library in in Quasar- http://stackoverflow.com/a/4687050/72070 http://stackoverflow.com/a/4687050/72070 Thanks for the note swannodette, I'd missed the reference.