Interference
CS 536 Notes, Lecture 13, Mon Nov 29, 2010
A. Why
•
Shared memory parallel programs can interfere with each other.
•
We want to Fnd a way to guarantee that combining sequential threads won’t cause
interference.
B. Outcomes
After this lecture, you should
•
Know what will be covered on the ±inal Exam.
•
Know how to check for interference between the correctness proofs of the sequential
threads of a shared memory parallel program.
A. Final Exam Study Guide
•
±inal Exam: Monday December 6, 7:30 – 9:30 pm.
•
Comprehensive exam
•
(All percentages ²5%):
•
10% Quiz 1 material
•
10% Midterm (but not Quiz 1) material
•
30% Quiz 2 material
•
50% material since Quiz 2.
•
This include expanding a partial proof outline to a full proof outline.
Material Since Quiz 2
•
Given a partial proof outline, expand it to a full proof outline.
•
Given a partial proof outline of a loop, Fnd a loop bound and give the extra conditions
needed to show termination. (Or, expand the whole thing into a full outline.)
•
Below, each starred section will have roughly the same number of points on the exam.
•
Rough = anywhere from 5 to 15 points.
★
±ind an invariant
•
By replacing a constant by a variable.
•
Hint: Check manifest constants (e.g. 2) and named constants (does it change
during the run of the program?)
•
By dropping a (single) conjunct.
•
Hint: Don’t forget that iterated relation tests are conjunctions:
(a = b = c)
is
equivalent to
(a = b
∧
b = c)
.
•
By adding a disjunct (our example took “=” to “
≥
”).
Illinois Institute of Technology
Notes for Lecture 13
CS 536: Science of Programming
 1 of 10 
© James Sasaki, 2010
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document★
Array Assignments
•
wp
(
b[
e
₁
]:=
e
₂
,
P
) involves substitution
P
[
e
₂
/
b[
e
₁
]
], which involves
e
′
[
e
₂
/
b[
e
₁
]
for a
general expression
e
′
.
•
Calculating
P
[
e
₂
/
b[
e
₁
]
]:
•
Easy case:
e
₂
doesn’t contain
b
: then
P
[
e
₂
/
b[
e
₁
]
] is just
P
.
•
Example: (
y[5]
≤
x
)[
e
₂
/
b[
e
₁
]
] is
y[5]
≤
x
.
•
Fairly easy case:
e
₁
doesn’t contain
b
and
P
contains
b[
e
₁
]
. (Note: the same
subscript as on the l.h.s. of the assignment.)
•
Then replace the
b[
e
₁
]
inside
P
by
e
₂
.
•
Example: (
2 * b[z+1]
≤
y
)[
e
₂
/
b[z+1]
] is
2 *(
e
₂
)
≤
y
.
•
General case: (
b[
e
₃
]
)[
e
₂
/
b[
e
₁
]
] is
if
e
₃′
=
e
₁
then
e
₂
else
b[
e
₃′
]
fi
, where
e
₃′
is
e
₃
[
e
₂
/
b[
e
₁
]
].
•
Example: (
y + b[y]
≤
z
)([
b[y/2]
/
b[z+1]
]) is
(y + (if y = z+1 then b[y/2] else b[y] fi)
≤
z)
•
It can be helpful to statically simplify predicates involving conditional
expressions.
•
E.g., we can replace
if
B
then
e
else
e
fi
by just
e
.
★
Evaluation Graphs for Parallel Programs; Disjoint Parallel Programs
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '08
 cs536
 Illinois Institute of Technology, James Sasaki, proof outline

Click to edit the document details