Information on the other part of the course is available on the
maintained by G. Lettieri.
The course is aimed at providing students with a comprehensive
vision of the foundations of concurrent and distributed
programming. The main focus of the lectures is on system
models and on different types of frameworks intended to
support the development of concurrent systems at different
abstraction levels and on different underlying platforms.
Students will acquire the basic skills to participate in the
design, implementation and integration of concurrent and
distributed software systems, possibly made of heterogeneous
components.
Prerequisites: knowledge of Operating Systems basics, and
mastering of Java and C/C++.
-
ATTENTION:
An extra oral exam is scheduled on
Dec. 3rd, 2020 h. 8:30 am, to be held online on the MS Teams
platform. No sign-in is
required: please confirm participation to the teacher by email.
-
The dates for oral exams are reported on the
website of the School
of Engineering.
Students are required to
register through the Exam
Sign-in Portal at least two days before the exam
date.
First lecture on Wed. Sept. 26th, 2018
Mon. 11:30-13:30
ADII 2 (usually, Bechini); Tue. 14:30-16:30 ADII 1
(usually, Bechini); Wed. 8:30-10:30 ADII 1 (usually,
Bechini); Thu. 13:30-15:30 ADII 2 (usually, Lettieri)
The lectures' schedule and relative updates, as well as
exam dates, are available on a public Google
Cal, which can be imported with the following ICS
address:
https://www.google.com/calendar/ical/orl95i8nga1ar07d2g9fmedvg4%40group.calendar.google.com/public/basic.ics
A detailed description is available via the record of
lessons (see the left menu item).
Hereafter, a cathegorized list of topics can be
interactively explored.
Introduction
Notion of concurrency

Partial and total ordering of activities

Processes and threads


Thread pooling and Executors for Java tasks


Use of Future objects with ExecutorService

Speedup of a parallelized application: Amdhal's law, Gustafson's law

Models and paradigms: Shared memory vs. message passing
Shared memory model
Mutual exclusion

Classes of critical sections


Naif software approaches, Peterson's solutions


The Lock concept and object-oriented idioms


Hardware support by Test-And-Set, Compare-And-Swap, Fetch-And-Add

Synchronization/communication



Avoidance of busy-waiting and starvation, 'sleeping' locks


Higher-level control: Condition variables (in Pthreads and Java)



Rationale for the Construct



Hoare's Monitor, semantics 'signal-and-urgent-wait', 'signal-and-wait', 'signal-and-return'



Mesa-style Monitor and Java Monitor; notifyAll()



Use of counting semaphores in Java



Models, and memory barriers



The Java Memory Model based on happened-before

Typical synchronization problems

Bounded buffer - Java BlockingQueue


Readers and writers - Java ReadWriteLock



Approaches to deadlock management, trylock

Non-blocking algorithms

Generalities, use of CAS, optimistic assumptions


Michael and Scott's queue

Development of Java multithreaded applications

Synchronized/concurrent collections


Synchronizers (latches, etc.)


Unit testing, generalities on testing of concurrent Java programs
Message-passing model
Models for distributed systems

Asynchronous and synchronous models

Process addressing and channels


Unblocking and blocking constructs


Bounded buffer problem in asynchronous model

The Actor model


Relation to multithreaded and distributed applications


Example: the Akka framework

Precedence and causality


Lamport's timestamps (partial/total order)


Vector timestamps, properties, consistent cuts


Physical clock sychronization - concepts and algorithms

Distributed mutual exclusion


Ricart-Agrawala algorithm, token ring solution

Dealing with faults


Election: ring-based and bully algorithm


The Byzantine Generals problem



Possibility of solution for N>=3f+1
Communication Frameworks and APIs
Low-level APIs



Connectionless and connection-oriented communication

Direct and indirect communication

RPC - Remote Procedure Call


Request-reply protocols, idempotent operations



RPC's Interfac Description Languages (IDLs)


RMI - Remote Method Invocation


Remote interfaces and remote references



Architecture: servants and location services



Distributed garbage collection


Message-oriented middleware


Message queues and publish-subscribe systems



JMS - Java Message Service



SOAP-based Web Services and relative architecture/protocols



RESTful Web Services and REST resource management
Frameworks for applications' support
Basic patterns and architectures


Container pattern and interception


MVC - Model View Controller

Web applications

Architecture of a Web server


State-aware computations and session management



Lifecycle and service methods



Classes, configuration, and deployment


Deployment descriptors, convention over configuration

Distributed components


EJBs - Enterprise Java Beans


Session EJBs: stateless and stateful



Management strategies and implementation



EJB interfaces and lookup via JNDI



Context and Dependency Injection via annotations
The final test is organized as follows:
a) development of a project; specifications must
be agreed upon with the teacher; the finalized work must be
shown to the teacher for final approval prior to the oral exam (not in
the same date)
b) oral exam (possibly with written exercises), on
all the topics covered by the course.
All the course contents are covered within the textbooks and
other material reported hereafter. These references can also
be taken as suggestions for in-depth discussions on class
topics.
Books:
|
T1
-
Title Operating
System Concepts 9th ed.
Authors Abraham Silberschatz, Peter B.
Galvin, Greg Gagne
Pub.
Wiley
ISBN
9781118093757
Notes:
A classical resource on OSs,
discussing
synchronization problems as well.
|
T2
-
Title Distributed
Systems - Concepts and Design 5th ed.
Authors George Coulouris, Jean Dollimore,
Tim Kindberg, Gordon Blair
Pub.
Addison-Wesley
ISBN10
0132143011
Notes:
A comprehensive overview of
distributed systems,
addressing
both theoretical and architectural issues.
|
Classwork material:
Provided after each lab session.
- CW01 (data
races, ThreadLocal, AtomicInteger, Peterson)
- CW02
(bounded buffer with condition variables and
semaphores)
- CW03 (task
executors, thread pooling, futures)
- CW04 (periodic
task scheduler, benchmarking)
- CW05 (unit testing,
custom synchronizer)
- CW06 (multiple
projects - RMI example)
- CW07 (basic use of
Servlets)
- CW08 (multiple projects - stateless/stateful session EJBs)
- CW09 (JEE global project with JMS communication and Message-driven EJB)
- CW10 (Simple Maven project in NetBeans)
|
Misc:
S1/2/3/4 - Slides on related topics, available
on the web: Generics,
Nested
classes, JCF,
and
JUnit
S5 - Slides on Java
Executor Framework (from a course at the Univ.
of Birmingham)
W1 - Tutorial on Java
High Level Concurrency Objects (not all details
have been mentioned at lesson)
W2 -
Online paper
for those who want to delve into the "Double-checked locking" trick.
C1/2 - Java code for examples of non-blocking
synchronization: Treiber's
stack and Michael/Scott's
queue
W3 - Tutorial on MPI
(from Lawrence Livermore National Lab; here,
another nice one).
W4 - Online paper on issues in
Java benchmarking
W5 - Tutorial on Java
RMI (for "general" distributed objects: Java
IDL)
S6 - Slides (commercial-style presentation) on
Akka and the related Actor model.)
W6 - Tutorial on Java
EE - massive official document: only Servlets
(no asynch mode), EJBs, and JMS are in our syllabus
|
The following web references can be useful for practical
programming.
L1 -
NetBeans
IDE
L2 -
Eclipse
IDE
L3 -
Cheat
sheet for JCF
L4 -
MPI
home,
Open
MPI
L5 -
Akka
L6 - Maven
slides
and
site
The backgroung images for this page have been obtained
by reworking the "simple icons" for AWS
(http://aws.amazon.com/architecture/icons/).