Today’s lecture set out some alternative approaches for managing concurrency in programming languages: asynchronous message-passing Actors and the always-upbeat optimistic concurrency of Software Transactional Memory. These are two examples from a wide range of mechanisms in use across many programming languages and applications domains, all of which seek to balance the key concurrency requirements of separation to prevent inconsistency and co-operation to allow interaction.
Links: Slides for Lecture 10; Audio recording (may require Flash)
Homework
1. Read these
The Go language provides concurrent goroutines and named channels for communication between them. Read these two articles about this.
-
Caleb Doxsey. Concurrency.
Chapter 10 in An Introduction to Programming in Go. -
Ivan Daniluk. Visualizing Concurrency in Go.
Make sure you don’t miss the interactive WebGL animations.
If you are interested to find out more, then try these two video talks by Rob Pike.
You can also see more code details in the following.
- A Tour of Go: Goroutines (Russ Cox)
- Go by Example: Goroutines (Mark McGranaghan)
2. Do this
Who uses Erlang? What do they do with it?
- Read up about Erlang, its use of actors, supervision, and live code replacement.
- Find an example of some software / a system / a service / a company that uses the language and where someone has written about that.
- Post the example to the mailing list or Piazza.
I’m collating examples below.
![]() |
Erlang and First-Person Shooters 10s of millions of Call of Duty Black Ops fans loadtest Erlang Malcolm Dowse, Demonware Presentation at Erlang Factory, London 2011 Links: Overview; Slides; Erlang Factory |
![]() |
Inside Erlang, The Rare Programming Language Behind WhatsApp’s Success. Ainsley O’Connell Fast Company, February 2014. Link: Article |
References
![]() |
What is Scala? Martin Odersky Link: Article |
![]() |
Akka Actor-style concurrency for Scala, with message-passing and supervision trees. Link: Home page |
![]() |
Practical Lock-Freedom Keir Fraser PhD thesis, 2004. Technical report 579, University of Cambridge Computer Laboratory. Links: Report; More on lock-freedom |
![]() |
Clojure STM — What? Why? How? Neale Swinnerton (sw1nn), November 2012 Article explaining software transactional memory in Clojure with dosync and ref .Link: Article |