Concurrency & Multithreading 2010-2011
Lectures
week 13-16,18-19: Monday 9.00-10.45 in room F654
week 13-16,18-20: Wednesday 15.30-17.15 in room F654
lecturer: Wan Fokkink
Exercise classes
week 13-16,18-19: Tuesday 15.30-17.15 in room F654
week 13-15,19-20: Friday 9.00-10.45 in room F654
week 16: Thursday 11.00-12.45 in room F630
teaching assistant: Ben van Werkhoven
Computer labs
Thursday April 21 9.00-10.45 in computer room P337
NEW!: Friday May 20 13.30-15.15 in computer room P337
lecturers: Pieter Hijma and Stefan Vijzelaar
Goal
To obtain a good understanding of concurrency concepts and multicore computing.
Slides
NEW! Revised copies of the slides.
Book
The lectures are based on Maurice Herlihy and Nir Shavit, The Art of Multiprocessor Programming, Morgan Kauffman, 2008.
Have a look at the list of errata from the authors and my own errata.
Schedule per lecture:
- H 1.1-1.3, 1.5-1.6: Introduction: SMP and NUMA architectures, flag protocol for mutual exclusion, can protocol for producers-consumers, Amdahl's law;
H 3.7: Progress properties.
- H 2.1-2.6, 2.8: Mutual Exclusion: Critical sections, locks in Java, Peterson lock, Filter lock, volatile variables, Bakery algorithm, lower bound on the number of locations.
- H 3.1-3.2, 3.4-3.6, 3.8: Concurrent Objects: Pre- and postconditions, linearizability, wait-free bounded queue, sequential consistency;
H 4.1, 4.2.4-4.2.6: Foundations of Shared Memory: From regular SRSW to atomic SRSW, from atomic SRSW to atomic MRSW, from atomic MRSW to atomic MRMW.
- H 5.1-5.4, 5.6-5.8: The Relative Power of Primitive Synchronization Operations: Consensus, impossibility of consensus with atomic registers, 2-thread consensus with a queue, impossibility of 3-thread consensus with a queue, read-modify-write registers, n-thread consensus with compareAndSet;
H 6.1-6.4: Universality of Consensus: A wait-free universal construction.
- H 7.1-7.6: Spin Locks and Contention: TAS and TTAS locks, exponential back-off, Anderson queue lock, CLH queue lock, MCS queue lock, CLH queue lock with timeout.
- H 8.1-8.4: Monitors and Blocking Synchronization: Monitors, conditions, bounded queue with locks and conditions, the lost-wakeup problem, readers-writers lock, reentrant lock, semaphore.
- Multithreaded programming: Pieter Hijma discusses an example multithreaded program in detail.
- H 17.1-17.6, exercises 202,207: Barriers: Sense-reversing barrier, static tree barrier, combining tree barrier, tournament barrier, dissemination barrier, termination detection barrier.
- H 9.1-9.9: Linked Lists: The Role of Locking: Coarse-grained synchronization, fine-grained synchronization, optimistic synchronization, lazy synchronization, lock-free synchronization, AtomicMarkableReference class.
- H 10.1-10.6 (not 10.6.1), 11.1-11.4: Concurrent Queues and Stacks: Fine-grained bounded and unbounded queue, unbounded lock-free queue, the ABA problem, unbounded lock-free stack, elimination backoff array.
- H 16.1-16.2, 16.4-16.5.1: Work Distribution, Futures and Scheduling: Work-stealing bounded queue, parallelization of matrix operations and the Fibonacci numbers, thread pools in Java, measuring parallelism.
- H 18.1-18.3.7, 18.4: Transactional Memory: What is wrong with locking and compareAndSet, transactions, unbounded and bounded transactional queues, MESI cache coherence protocol, hardware transactional memory, software transactional memory, conflict resolution policies.
- Question hour
Exercise classes
- 1 2 3 4 5 6 8
- 9 10 11 12 13 14 15 16
- 24 27 28 32 33 36 40 41 42 46
- 52 53 54 55 57 76 77 80 83
- 85 86 91 92 extra exercises I and II
- 93 95 96 98
- No exercise class
- 199 extra exercise III 202 204 207 208 210
- 100 101 102 103 104 105 106 108 109 112 113 114 115 117 118
- 120 121 122 123 124 125 126 127 128 129
- 185 186 188 190 191 192 193(1) 196
- extra exercises IV and V 211 213 223
- Exam from last year is discussed.
Programming assignments
For the BSc variant of this course there will be two small programming assignments, which together will count for 20% of the final mark.
For the MSc variant of this course there will be one small and one larger programming assignment, which together will count for 30% of the final mark.
You can make these assignments either alone or in a team of two persons.
Assignment 1 (deadline April 27, 4pm).
NEW! Assignment 2 (deadline hard as nails, May 30, 1pm).
Download the source tree skeleton for assignment 2. The referenced paper can be found here (free to download from the VU).
Written exam
The written exam will count for BSc students for 80% and for MSc students for 70% of the final mark. For the material you need to study for this exam, see the "schedule per lecture" and the slides; you should also study appendices A and B. Material from the textbook that is not covered during the lectures (e.g., several correctness proofs) does not have to be studied for the exam! At the exam, you may use the textbook of Herlihy and Shavit. Answers can be given in English or Dutch. (You are not allowed to use the slides, or a laptop.)