CP: Concurrency: State Models and Design Patterns


Course: 21005 (Autumn Semester 2019)
Lecturer:Prof. Oscar Nierstrasz
Assistants:Pascal Gadient, Mohammadreza Hazhirpasand
Lecture:Wednesday, 10h15 - 12h00
Exercises:Wednesday, 12h00 - 12h45
Place:Engehaldenstrasse 8, 003
Repetition:Autumn 2021


This course provides an introduction to concurrent programming with Java. The course focuses on fundamental concepts important for developing correctly functioning concurrent programs, such as safety, liveness and fairness, and on standard programming patterns and techniques for dealing with these issues. The course will include two lab sessions (replacing the regular lecture hours) in which students will work in small groups to apply the techniques presented.

Much of the practical material in this lecture will be based on: Doug Lea, Concurrent Programming in Java: Design Principles and Patterns, Addison-Wesley, 1999. The theoretical foundations will be based on: Jeff Magee and Jeffrey Kramer, Concurrency: State Models & Java Programs, John Wiley, 1999.

Learning Outcomes

On successful completion of this course, you will be able to:

  • Reason about safety, liveness and fairness in concurrent programs
  • Use model-checking tools to prove safety and liveness properties
  • Use synchronization mechanisms to guarantee thread safety in programs
  • Reason about communication mechanisms to manage threads
  • Use practical techniques to avoid deadlock and ensure liveness
  • Reason about architectural styles to avoid concurrency issues


The final grade in the course will be based 30% on exercises and 70% on the final exam.

Course Schedule

1 18-Sep-19 Introduction
2 25-Sep-19 Java and Concurrency
3 2-Oct-19 Safety and Synchronization
4 9-Oct-19 Safety Patterns + Transactional Memory
5 16-Oct-19 Liveness and Guarded Methods
6 23-Oct-19 Lab session
7 30-Oct-19 Liveness and Asynchrony
8 6-Nov-19 Condition Objects
9 13-Nov-19 Fairness and Optimism
10 20-Nov-19 Lab session
11 27-Nov-19 Petri Nets
12 4-Dec-19 Architectural Styles for Concurrency
13 11-Dec-19 Actors and Scala — Haidar Osman guest lecture
14 18-Dec-19 Exam


PLEASE READ THIS FIRST! - How to submit your solutions

Week Practical Session PDF Assignment PDF Solution PDF
01 P01 A01 S01
02 P02 A02 S02
03 P03 A03 S03
04 P04 A04 S04
05 P05 A05 S05
06 Lab 01 no assignment this week no solution this week
07 P07 A07 S07
08 P08 A08 S08
09 P09 A09 S09
10 Lab 02 no assignment this week no solution this week
11 P11 A11 S11
12 P12 A12 S12
Last changed by admin on 21 April 2009