The Artima Developer Community
Sponsored Link

Java Community News
Clustering Scala Actors with Terracotta

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Clustering Scala Actors with Terracotta Posted: Jan 29, 2008 4:53 PM
Reply to this message Reply
Jonas Bonér released an integration module for Terracotta that allows Scala actors to scale across servers.

Scala implements the Actor model for concurrency: because an Actor contains no shared state, Actor-based concurrency is simpler to work with than the shared-state concurrency model of, for example, Java. Due to lack of shared state, Actor-based concurrency can also scale to potentially larger number of processors than parallel applications relying on shared-state.

While many concurrent systems today aim to take advantage of multi-core CPUs, Actor-based concurrency was initially developed for multi-processor machines and distributed clusters. Jonas Boner recently made it possible to distribute Actor-based Scala programs on a cluster of compute nodes using Terracotta's open-source JVM clustering tool.

In a recent article introducing the Terracotta Scala Actor integration, Clustering Scala Actors with Terracotta, Boner describes the utility of Actors in a highly concurrent environment:

An Actor is an abstraction that implements Message-Passing Concurrency. Actors have no shared state and are communicating by sending and receiving messages. This is a paradigm that provides a very different and much simple concurrency model than Shared-State Concurrency (the scheme adopted by C, Java, C# etc.) and is avoiding most of the latter one’s complexity and problems.

This makes it possible to write code that is deterministic and side-effect-free, something that makes it easier to write, test, understand and reason about. Each Actor has a mailbox in which it receives incoming messages and normally uses pattern matching on the messages to decide if a message is interesting if action is needed.

Boner points out that while Actor-based shared-nothing concurrency is potentially useful, it also requires a new programming paradigm:

How can we make applications build on this “new” programming model highly available and how can we scale them out, if necessary. Would it not be cool if we could not only parallelize our application onto multiple threads but also onto multiple machines?

I have spent some time last weeks looking into if would make sense to utilize Terracotta to cluster the Scala Actors library to give a platform on which we can both scale Actors out in a distributed fashion and ensure full fault tolerance and high-availability. The result of this exercise have been successful and I’m happy to announce that they work very nice together.

Boner released the source code for a Terracotta integration module that make Actor-based Scala programming simple with Terracotta. Once configured, the Terracotta infrastructure transparently distributes Actor instances on available JVMs.

What do you think of Scala's Actor-based concurrency, and of scaling Actor-based programs with Terracotta?

Topic: Daniel Spiewak Explains Scala Pattern Matching Previous Topic   Next Topic Topic: Bill Venners on the Rise of Scala

Sponsored Links


Copyright © 1996-2018 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use