Title: Verification of mutual exclusion algorithms with EST
1Verification of mutual exclusion algorithms with
EST
ERK 2001
- Robert Meolic, Tatjana Kapus, Ernest Gungl,
Zmago Brezocnik
2Verification of mutual exclusion algorithms with
EST
- Introduction
- Mutual exclusion algorithms
- Formal verification
- Equivalence checking
- Model checking
- Demonstration
3Introduction
- A critical section is a block of code in a thread
that accesses one or more shared variables in a
read-update-write fashion. - In such a situation we want mutual exclusion
only one thread at a time can access
(read-update-write) a shared variable at a time. - The mutual exclusion problem is how to keep two
or more threads from being in their critical
sections at the same time.
4A critical section and mutual exclusion
- while (true)
- outsideCS()
- wantToEnterCS(i)
- insideCS()
- finishedInCS(i)
5Dekkers algorithm (1965)
while true dobegin ltnoncritical sectiongt
bi true while bj do begin if k
j then begin bi false
while k j do skip bi true
end end ltcritical sectiongt k
j bi falseend
- Mutual exclusion with shared variables and
referee - variables b1 and b2 (false or true)
- variable k (1 or 2)
Dekkers algorithm is very efficient algorithm
for handling two concurrent processes.
6Hymans algorithm (1966)
while true dobegin ltnoncritical sectiongt
bi true while k ? i do begin
while bj do skip k i end
ltcritical sectiongt bi falseend
7Petersons algorithm (1981)
while true dobegin ltnoncritical sectiongt
bi true k j while (bj and k j)
do skip ltcritical sectiongt bi
falseend
8Formal verification
- Mentor Graphics FormalPro
- Equivalence checking
- Have I corrupted my design with changes?
- Model checking
- Have I designed what I wanted to design?
9Why formal verification?
Source Mentor Graphics Web page
10Source Mentor Graphics
11Efficient Symbolic Tools
- Realized on Faculty of Electrical Engineering and
Computer Science in Maribor - The project started in year 1992
- GNU General Public License
- It runs on many different computers with
different operating systems, including HP-UX,
Linux, and Windows.
http//www.el.feri.uni-mb.si/est/
12Demonstration
- Verification of Hymans algorithm (MC) - does
not preserve mutual exclusion - Verification of Petersons algorithm (MC) -
preserve mutual exclusion - Our model contains divergent states (MC) - we
eliminate divergent states - Modification was not correct! (EC) - we improve
our model
13Modified model of Petersons algorithm
?
14Further work
- Mutual exclusion algorithms for 3 or more
processes, e.g. Lamports algorithm - Automatic trasformation from programming language
to process algebra description - Model checking with fairness constraints