|
Concurrent and Distributed Programming and Systems 2019/2020
Tuesday 9:50-13:00 M.VIII
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.
Lecture notes
Tutorial on PC timers
Linux
man clock_gettime(CLOCK_MONOTONIC_RAW, ...)
Linux Device Drivers (Chapter
7)
- Threads. Thread state diagram. Shared variables, atomicity of memory
accesses, critical regions. Decker's and Peterson's algorithms, assumptions
on memory accesses. Deadlock, livelock. POSIX threads (pthread), mutexes,
condition variables.
Lecture notes
Open Group pthread
reference
A pthread tutorial
Another pthread tutorial
Historical
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.
SCJP
Sun Certified Programmer for Java (Chapter 9)
H.
Schildt: Java, The Complete Reference (Chapter 11)
- Multi-level memory. Examples of counter-intuitive behaviour of programs
and their explanation.
Means of memory synchronisation in C and Java. Volatile variables, implicit
memory synchronisation.
Java memory model
(JSR133)
Memory
models
Homeworks
Please send me your solutions via email.
The firm deadline for submission of overdue homeworks is 9.12.2019.
Homework 1 (due to 12.11.)
Homework 2 (due to 19.11.)
Homework 3 (due to 6.12.)
Homework 4 (due to 6.12.)
Updated by
Tomas Plachetka,
Dec/24/2019
|