• Keine Ergebnisse gefunden

if (y.load(acq))then t1 =∗a

N/A
N/A
Protected

Academic year: 2021

Aktie "if (y.load(acq))then t1 =∗a"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

SS 2014 23.07.2014 Exercises to the lecture

Concurrency Theory Sheet 14

Roland Meyer, Viktor Vafeiadis Optional sheet, no delivery Exercise 14.1

Consider the following lock implementationlock(l) from the lecture:

do

T =l.CASacq(0,1);

if ¬tthen

while (l.load(rlx)6= 0);

while(¬t)

Prove that {Lock(l, P)}lock{Lock(l, P)∗P} holds.

Exercise 14.2

Construct a proof in relaxed separation logic that the following program is data race free.

∗a= 7;

∗b= 8;

y.store(1,rel);

if (y.load(acq))then t1 =∗a;

if (y.load(acq))then t2 =∗b;

∗b=t2+ 1;

Exercise 14.3

Use the following program prog to prove that the rules for relaxed memory accesses are unsound if there is a dependency cycle.

x=y= 0 if (x.load(rlx) == 1) then

y.store(1,rlx);

if (y.load(rlx) == 1) then x.store(1,rlx);

t=x.load(rlx);

Hint: Show that {true}prog{t = 0} is derivable using RSL.

Exercise 14.4

Prove that in the following program,m always contains an even number:

x=y= 0 t=x.load(rlx)

x.store(t+ 2,rlx)

u=x.load(rlx) x.store(u×2,rlx)

m=x.load(rlx)

Referenzen

ÄHNLICHE DOKUMENTE

[r]

- Tip: Wenn keine Nachricht den Schnitt (von links nach rechts??) überquert, ist der Lebensfaden des Systems gerissen; rechts des Schnittes kann dann keine Aktivität mehr

openr,1,’test.txt’ opens read access to file test.txt (connected via logical unit 1). openw,1,’test.txt’ opens write access to test.txt readf,2,a unformatted read from logical

A finite graph contains a Eularian cycle, if there is a cycle which visits every edge exactly once. This is known to be equivalent to the graph being connected (except for nodes

Throughout, R denotes a ring, and, unless otherwise stated, all rings are assumed to be associative rings with 1, and modules are assumed to be left

the Instant-C program, the library source files, a stand-alone version of the Instant-C editor, and screen programs your keyboard for configuring PC have IBM an or compatible, if

Prove: Let CP(R, G) be defined as the set of critical pairs regarding R and the set of equations G oriented in both ways?. If R is left-linear, then the following statements

b) Bestimme die Ableitung