Scala for Multicore

UPMARC Multicore Computing Summer School 2011

Philipp Haller, EPFL and Stanford University

In this series of lectures, I'll introduce several approaches to parallel and concurrent programming in Scala. We'll begin with an introduction to Scala's actors library which combines event-based and thread-based models of concurrency. Using a novel type system extension based on static capabilities, we'll show how actor isolation and race freedom is enforced. We'll also show how to provide custom type system extensions as plugins for the Scala compiler. In addition to our detailed treatment of Scala actors, we'll also cover other approaches to parallel programming in Scala such as parallel collections and parallel embedded domain-specific languages (DSLs). The talk concludes with an outlook of possible future directions of Scala for multi-core programming.


Actors in Scala, 2011. Written by Philipp Haller and Frank Sommers. The definitive guide, covering Scala Actors and Akka.


Day 1:

Scala for Multicore: Foundations and Message-Passing Concurrency [Slides]

Day 2:

Scala for Multicore: Parallel Collections and Parallel DSLs [Slides]

Code Examples From The Talks

Intro to Scala

Scala Classes
Pattern Matching
Partial Functions
Scala Actors

Parallel Collections

Manipulating part of Wikipedia


Getting Scala The Scala language's home on the web. New language releases are announced and released here, there are learning resources, support forums, and more.

A new company founded by Martin Odersky has released the Typesafe Stack, which bundles of all of the most up-to-date Scala goodies into one easy download.

Useful Scala Tools

The Scala IDE for Eclipse. The best IDE out there for working with Scala code. Find out while you work whether or not your code will compile, and easily navigate through class hierarchies.

Don't want to install Scala? There's an online interpreter at SimplyScala.

Getting Started with Scala

Programming in Scala, 2nd edition, 2010. Written by Martin Odersky, Bill Venners, and Lex Spoon. The definitive guide.

Functional Programming: Functional programming for the object oriented and Exercises for beginners in Scala.

Scala Actors: Scala Actors: A Short Tutorial

Other Topics Covered in the Talks

Parallel Graph Processing: menthor: Parallelizing Machine Learning– Functionally, our Pregel-like Bulk Synchronous Parallelism in Graph Processing project.

Parallel Collections: Watch Alex Prokopec present Scala 2.9's new parallel collections at Scala eXchange, on June 15, 2011. Or, take a look at his technical report.

Uniqueness Types: See the Capabilities for Uniqueness and Borrowing page for many more resources on uniqueness types, instructions on how to obtain and compile the experimental Scala compiler plug-in, as well as the ECOOP 2010 paper, slides, and a techinical report on the subject. For more details related to concurrency not found in the above link/papers, see Philipp's PhD thesis.

Links from the Slides