CPS 512 (Duke University) Distributed * Systems
home calendar topics work resources

Lab 2: Distributed Locks


Due Date: 10/1/2015
Please work in groups of two.

Your goal in this assignment is to write a simple lock server and client using Akka actors in Scala. There are a variety of distributed mutual exclusion protocols with varying degrees of decentralization and fault tolerance. In this lab the lock service is a single LockServer node: we presume that it does not fail.

Like our other labs this semester, the nodes in the distributed protocol are represented by actors. For our testing the nodes/actors run within a single process, but your code should be designed to work even if nodes/actors run on different machines (i.e., no shared data structures). Note that actors may also be useful to represent concurrency within a node in the distributed protocol. For example, a client or server in your distributed lock system may have internal concurrency with multiple actors to manage multiple locks.

The lock system will follow the Leased Locks protocol discussed in class.

Your lock system should provide the following semantics and behavior: Implement some tests to demonstrate that your lock service is correct.

Note: You may find useful to use Akka schedulers to manage leases (http://doc.akka.io/docs/akka/snapshot/scala/scheduler.html). The scheduler allows you to schedule a message to be sent to an actor at a specified time or after a specified delay.