CS410/CS510 - Advanced Topics in Concurrency

When: Tue/Thu 1640-1830
Where: CH371
Instructor: Jonathan Walpole
Instructor Office Hours - By Appointment
Teaching Assistant: Ted Cooper
TA Office Hours - Tuesday: 12:30-1:30; Thursday: 3:20-4:20

If you are signed up for this class, please send me your preferred email address and your picture so I can learn who you are!

Description

This course explores a variety of shared memory concurrent programming techniques with special emphasis on their correctness, performance and scalability characteristics on modern CPU architectures.

The course is based on research papers. The reading list has been carefully selected from classical and recent research papers in order to introduce and develop key concepts and developments in concurrent programming on shared memory multiprocessors. You should read each paper carefully before the start of each class so that you are in a position to participate in class discussion. There will also be a sequence of programming assignments that give students practical experience with many of the concepts introduced through the lectures and reading assignments.


Prerequisites

This is an advanced class. If you have not taken, and passed with a grade B or better, an introductory course in operating systems this is certainly not the course for you! Take CS333 or the new graduate Operating System Foundations course first before attempting this class.


Text Book

There are no required text books for this class. Instead, the class is based primarily on a collection of research papers, listed below in the Schedule & Syllabus section.

The following two text books, available freely online, contain a lot of valuable information related to certain aspects of this course. These can be used to refresh background knowledge, but they are not a substitute for the reading assignments and lectures.


Grading

Your final grade will be calculated based on your exam performances in the midterm and final exams (equally weighted). The exam papers will contain questions directly related to the programming assignments, and this is how the understanding you gain by doing the programming assignments will contribute to your overall grade. The programming assignments themselves will not directly contribute to your grade, but you will receive feedback on your submissions and you should not consider the assigments to be optional.


Programming Assignments

This course has an extensive practical component, consisting of a sequence of a dozen, or so, programming assignments, described in more detail here.

Link to CS510 Programming Assignments

Mailing List

A "MailMan" e-mailing list will be maintained for this class. The list, called cs510walpole@cs.pdx.edu, is for communicating information relating to the course, and can be used by students as well as the instructor. All students should subscribe to this list. Go to the following web page and follow the instructions:

https://mailhost.cecs.pdx.edu/mailman/listinfo/cs510walpole


Schedule & Syllabus
Class 1
01-9-18
Introduction to Concurrency
Introducton to concurrency. Reasoning about concurrent programs using the memory invariance property. Data races. Techniques for constructing data-race-free programs, spin locks, semaphores, monitors and condition variables. Memory invariance properties of code that uses synchronization primitives, and code that implements the primitives themselves. Why use concurrency? Is concurrency worth the trouble, and how can you tell?

Course overview slides: [pptx] [pdf]
Slides for class 1: [pptx] [pdf]

The following book (free) contains a lot of useful background information and programming examples related to conventional approaches to concurrent programming. Refer to it as necessary to refresh your background knowledge. "The Little Book of Semaphores, Second Edition" Allen B. Downey, 2016.

Class 2
01-11-18
Concurrency in the Linux Kernel
A review of basic concurrency issues and synchronization mechanisms used in the Linux kernel. Symmetrical multiprocessing architectures, true vs pseudo concurrency and strategies for managing them. Simple atomic operators, spin locks, semaphores. Difficulties of using synchronization in interrupt handlers. Scalable locks: reader-writer locks, scalable/asymmetrical reader-writer locks.

Reading: Slides for class 2: [pptx] [pdf]
Class 3
01-16-18
Spin Lock Performance
Understanding the performance of spin locks. Review of CPU cache architecture and performance, cache lines, sets, ways, associativity. Types of cache miss: warm-up miss, capacity miss, associativity miss, write miss, communication miss. Cache coherence protocols, four-state MESI protocol. Implementation strategies for spin locks, with emphasis on memory and bus contention issues and design strategies that improve performance and scalability.

Reading: Slides for class 3: [.ppt] [.pdf]
Class 4
01-18-18
Non-blocking Synchronization
Building concurrent data structures without using locks, optimistic vs pessimistic concurrency control, non-blocking concurrent stack implementation based on Compare and Swap (CAS), the ABA problem.

Reading: Slides for class 4: [.pptx] [.pdf]
Class 5
01-23-18
Non-blocking Synchronization: Practical Blocking & Non-Blocking Queue Algorithms
Comparison of lock-based vs non-blocking concurrent queue algorithms built using Compare and Swap (CAS) which is a readily available instruction on modern CPUs. Effects of preemption on performance of locking and non-blocking synchronization. Reasoning about the correctness of algorithms that execute without the memory invariance property holding.

Reading: Slides for class 5: [.ppt] [.pdf]
Class 6
01-25-18
Non-blocking Synchronization: General Methodology
A general methodology for converting sequential objects to non-blocking objects. Hiding multiple updates behind a single pointer update. Update-in-place vs creating new versions and how to manage old versions. Linearizability, correctness vs sequential equivalence. Non-blocking vs wait-freedom fault-tolerance properties and their impact on performance scalability.

Reading: Slides for class 6: [.pptx] [.pdf]
Class 7
01-30-18
Memory Access Reordering by Hardware
Sequential consistency. Reasoning about concurrency in the absence of sequential consistency. Review of memory consistency models used by modern CPUs. Impact of these models on the algorithms discussed earlier in this course? Memory barriers, what they are and how to use them.

Reading: Slides for class 7: [.pptx] [.pdf]
Class 8
02-01-18
Memory Access Reordering by Compilers
Review of compiler memory access reordering when concurrency is not part of the programming language specification, and hence is unknown to the compiler (i.e. when threads are implemented as a threads-library). Why writing data race free programs is almost enough, but not quite. Solutions for programs that contain data races. Summary of C++11 memory model, atomics, and memory ordering behaviors.

Reading: Slides for class 8: [.pptx] [.pdf]
Class 9
02-06-18
Formal Reasoning About Memory Ordering
Event ordering in distributed systems, causality and the happens-before relationship, partial vs total orders, causal ordering. The Linux-kernel memory model, and its tool support for automated correctness checking.

Reading: Slides for class 9: [.pptx] [.pdf]
Class 10
02-08-18
Midterm Exam
Class 11
02-13-18
Safe Memory Reclamation via Hazard Pointers
Non-blocking concurrent algorithms based on creation of new versions, instead of update-in-place, require a mechanism for safe memory reclaimation. How can this problem be solved in a scalable concurrent way? Review of lock-free concurrent objects that use "hazard pointers" for safe and scalable memory reclamation. Discussion of memory barrier requirements and costs.

Reading: Slides for class 11: [.ppt] [.pdf]
Class 12
02-15-18
Read-Copy Update
Review of the Read-Copy Update (RCU) technique with lock-based writers, lock-free readers, and quiescent state based deferred reclamation, for practical scalable concurrent programming on modern architectures.

Reading: Slides for class 12: [.pptx] [.pdf]
Class 13
02-20-18
Guest Lecture [CANCELLED]
Guest lecture from Paul McKenney, Distinguished Engineer at IBM's Linux Technology Center, known for his pioneering work in scalable concurrent programming, particularly RCU and the Linux-kernel memory model.

Slides for class 13: [.pdf]
Class 14
02-22-18
RCU Case Studies
Case study of RCU usage in the Linux kernel. Case studies in relativistic programming: list move example, hash-table move, red-black tree.

Reading: Slides for class 14: part a [.pptx] part a [.pdf] part b [.pptx] part b [.pdf]
Class 15
02-27-18
Guest Lecture
Guest lecture from Paul McKenney, Distinguished Engineer at IBM's Linux Technology Center, known for his pioneering work in scalable concurrent programming, particularly RCU and the Linux-kernel memory model.

Slides for class 15: [.pdf]
Class 16
03-01-18
Scalable Concurreny: How Strong is Weak Ordering?
A discussion of the real-world ordering properties of linearizable and non-linearizable FIFO queue implementations.

Reading:
  • "How FIFO is Your Concurrent FIFO Queue?",
    Andreas Haas, Christoph Kirsch, Hannes Payer and Michael Lippautz
    In proceedings of RACES'12, Workshop on Relaxing Synchronization for Multicore and Manycore Scalability, Tuscon, Arizona, 2012.
Slides for class 16: [.pdf]
Class 17
03-06-18
Relativistic Programming Project Current Status
Ted's Thesis work.
Slides for class 17: [.pdf]
Class 18
03-08-18
Transactional Memory: Hardware Implementations
Introduction to the transactional memory abstraction as a means of simplifying concurrent programming. Outline of a hardware implementation of transactional memory.

Reading: Slides for class 18: [.pptx] [.pdf]
Class 19
03-13-18
Transactional Memory: Case Study HTM Use in an OS Kernel
Discussion of performance, I/O and scheduling interactions of transactional memory in an operating system.

Reading: Slides for class 19: [.ppt] [.pdf]
Class 20
03-15-18
Review: A Comparison of Synchronization Technologies
Comparison of relative merits of transactional memory and other synchronization techniques.

Reading: Slides for class 20: [.ppt] [.pdf]
Final Exam
03-20-18
Final Exam - 1730-1920


Back to Jonathan Walpole's home page