Concurrent and Distributed Programming and Systems 2018/2019
Tuesday 9:50-13:00 M.VI
The evaluation of work during the semester (homeworks) forms 50% of the
final grade, at least 40% are required.
- Motivation. Separation of algorithmic and concurrent aspects in C.
Memory and time complexity of programs with I/O operations and dynamic
memory allocation. Polling and its consequences.
- Measuring time. Sources of time in PCs, real-time clock (RTC),
programmable interrupt timer (PIT). Access to time sources and alarms in
POSIX processes. Precision of time measurements.
Tutorial on PC timers
man clock_gettime(CLOCK_MONOTONIC_RAW, ...)
Linux Device Drivers (Chapter
- Threads. Thread state diagram. Shared variables, atomicity of memory
accesses, critical regions. Decker's and Peterson's algorithms, assumptions
on memory accesses, proof of correctness. Deadlock, livelock. POSIX threads
(pthread), mutexes, condition variables.
Open Group pthread
A pthread tutorial
Another pthread tutorial
recommendation (when to use threads and when not, 1995)
- Libraries, thread-safety. Case
study: shared stack.
- Threads in Java. Creation of a thread. Synchronised methods,
synchronised blocks. Built-in reentrant mutexes. Methods join(),
wait(), signal(). Problem with a direct use of synchronized methods.
Sun Certified Programmer for Java (Chapter 9)
Schildt: Java, The Complete Reference (Chapter 11)
- Multi-level memory. Examples of counter-intuitive behaviour of programs.
Means of memory synchronisation in C and Java. Volatile variables, implicit
Java memory model
- OpenMP. Purpose, architecture. Fork-join parallelism.
GOMP (GNU OpenMP)
to OpenMP (RWTH Aachen University)
to OpenMP (University of Oregon)
- Paralellelisation of independent loops. Probabilistic model.
Deterministic model. Parameters of models, goals of optimisation.
Methods of load balancing.
Send me your solutions via email.
Homework 2 (till 5.11.)
Homework 3, attachment (till
Homework 4 (till 3.12.)