Past Meetup

Escaping concurrency - Actors and Fibers

This Meetup is past

151 people went

Location visible to members

Details

On our next meetup we'll discuss two (rather new) abstractions that claim to provide a better and easier programming model for building concurrent and distributed applications.

Actors, Evolved - Rotem Hermon, Gigya

The actor model is a novel approach to writing concurrent software. It is based on the concept of small computational units communicating through asynchronous message passing, thus allowing concurrency and scalability while negating a lot of the problems of concurrent programming.

Though the actor model got some adoption with the Erlang language and the Akka framework, it remained a rather niche approach and has not become a commonly used practice.

But this may be changing now with the introduction of “Virtual Actors” - a new abstraction for writing distributed applications. This abstraction was introduced with the Orleans framework by Microsoft and adopted to Java by EA with their Orbit framework.

This talk will include a short introduction to the actor model. We will then explore the Virtual Actors abstraction, how it’s different from the classic model, and why it makes distributed application programming a lot simpler.

Rotem Hermon is VP Architecture at Gigya.

The Power of Fibers (on the JVM) - Ron Pressler, Parallel Universe

The thread, the familiar software unit of concurrency, cannot directly model the concurrency of many problem domains, as managing a very large number of threads introduces unacceptable overhead. As a result, developers of concurrent software have come up with various approaches for scalable concurrency — from callbacks through promises to monads — all to circumvent threads as models for a unit of concurrency. But threads are not the problem. They are a clear and familiar abstraction that closely matches how code is normally written in most programming languages. The problem is their implementation. By adopting relatively arcane programming paradigms, software developers are abandoning the right abstraction for wrong ones, simply because of an inadequate implementation.

In this talk we’ll explore how lightweight threads (AKA fibers) match a good abstraction with the right implementation. We’ll see how any asynchronous API can be turned into a fiber-blocking one, and what can be achieved when a unit of software concurrency (a thread) directly models a unit of problem concurrency (e.g. a request). We’ll demonstrate that simple, familiar code can attain the same levels of performance and scalability as other, rather convoluted constructs.

I’ll present Quasar ( https://github.com/puniverse/quasar ), an open-source implementation of true lightweight threads on the JVM, and its various programming paradigms, like CSP and actors. We’ll see how more common patterns like Servlets are a good match for fibers, as well.

Ron Pressler is the founder of Parallel Universe, a YC company building a JVM-based server-side stack for easily writing high-performance, low latency applications that work in harmony with modern hardware architecture rather than fight it.