Kilim: Fast, lightweight, cheap message passing in Java. A million actors, 3x faster than Erlang
The message passing (MP) paradigm is often seen as a superior alternative to the typical mix of idioms in concurrent (shared-memory, locks) and distributed programming (CORBA/RMI). MP eliminates worries endemic to the shared-memory mindset: lock ordering, failure-coupling, low-level data races and memory models. It simplifies synchronization between data and control planes (no lost signals or updates), and unifies APIs for local and remote process interaction.
Curiously however, there are no efficient frameworks for intra-process message-passing, except for Erlang. This talk describes a Java framework called "Kilim" to fix this state of affairs. Kilim provides:
- Extremely lightweight user-level threads (actors) with automatic stack management, obtained via CPS transformation.
- A simple type system that ensures actor isolation by controlling pointer aliasing in messages at compile time, and by ensuring linear ownership of mutable message objects. This permits safe, zero-copy communication.
- A compact run-time library containing typed mailboxes (with optional flow control), user-definable scheduling and python style generators.
Kilim is portable; one of our explicit goals was to not require changes to the Java language syntax or to the JVM.
Kilim scales comfortably 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 (currently the gold standard for concurrency-oriented programming).
Speaker: Sriram Srinivasan
Sriram Srinivasan has 19 years of experience delivering a variety of systems spanning wireless sensors, messaging systems, middleware (he was a principal engineer of the Weblogic Application server) and large-scale applications such as cargo planning systems and network management systems.
He is currently on leave from industry, pursuing a PhD at the University of Cambridge. He is interested in mixing programming languages, concurrenct & distributed systems and modal logics.
Google Tech Talks
June, 11 2008