COMP31212
Two hours
UNIVERSITY OF MANCHESTER
SCHOOL OF COMPUTER SCIENCE
Concurrency and Process Algebra
Date: Friday 27th May 2016
Time: 09:45 - 11:45
Please answer any THREE Questions from the FIVE Questions provided
This is a CLOSED book examination
The use of electronic calculators is NOT permitted
[PTO]
, COMP31212
1. Modelling and implementing concurrent systems.
a) In the context of concurrent computational systems, explain briefly but clearly what
is meant by the following:
i. A process algebra,
ii. Interference,
iii. Mutual exclusion,
iv. Threads in Java,
v. Locks and synchronisation in Java.
(5 marks)
b) Explain clearly what is meant by a monitor as a device for structuring concurrent
systems. What sort of mechanisms may a monitor provide to control access?
(3 marks)
c) A building has two doors which record people entering and leaving via a shared
counter. The counter is incremented when a person enters the building and decre-
mented when a person leaves the building, so that the counter records the number
of people in the building.
Model this system of three concurrent processes using the process algebra FSP. In
your model, use an indexed process to model the counter, and process labelling to
form the composite system. (4 marks)
d) Now provide an implementation of the three interacting processes by writing an
outline program using threads in Java. (5 marks)
e) Explain carefully the relationship between your FSP model and the Java program
implementing it. You should explain in detail how the interaction between pro-
cesses corresponds to your use of threads, locks and synchronisation in Java.
(3 marks)
Page 2 of 7
Two hours
UNIVERSITY OF MANCHESTER
SCHOOL OF COMPUTER SCIENCE
Concurrency and Process Algebra
Date: Friday 27th May 2016
Time: 09:45 - 11:45
Please answer any THREE Questions from the FIVE Questions provided
This is a CLOSED book examination
The use of electronic calculators is NOT permitted
[PTO]
, COMP31212
1. Modelling and implementing concurrent systems.
a) In the context of concurrent computational systems, explain briefly but clearly what
is meant by the following:
i. A process algebra,
ii. Interference,
iii. Mutual exclusion,
iv. Threads in Java,
v. Locks and synchronisation in Java.
(5 marks)
b) Explain clearly what is meant by a monitor as a device for structuring concurrent
systems. What sort of mechanisms may a monitor provide to control access?
(3 marks)
c) A building has two doors which record people entering and leaving via a shared
counter. The counter is incremented when a person enters the building and decre-
mented when a person leaves the building, so that the counter records the number
of people in the building.
Model this system of three concurrent processes using the process algebra FSP. In
your model, use an indexed process to model the counter, and process labelling to
form the composite system. (4 marks)
d) Now provide an implementation of the three interacting processes by writing an
outline program using threads in Java. (5 marks)
e) Explain carefully the relationship between your FSP model and the Java program
implementing it. You should explain in detail how the interaction between pro-
cesses corresponds to your use of threads, locks and synchronisation in Java.
(3 marks)
Page 2 of 7