• Keine Ergebnisse gefunden

Problem 3: Invariants for Mutual Exclusion

N/A
N/A
Protected

Academic year: 2021

Aktie "Problem 3: Invariants for Mutual Exclusion"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Concurrency Theory(SS 2015) Out: Mon, Apr 20 Due: Tue, Apr 28

Exercise Sheet 1

Prof. Roland Meyer, Florian Furbach Technische Universit¨at Kaiserslautern

Problem 1: Shared Memory Concurrency

(a) Letload,storeandincbe atomic operations for loading a variable’s value into cache, storing a variable’s cache value into memory and incrementing a variable’s cache value by 1.

Ifxis initially0, argument why there are executions ending withx= 2015of the program fori= 1. . . 2015do

loadx incx storex end for

fori= 1. . .2015do loadx

incx storex end for

Misleading Hint: Each of the two above programs is basically incrementingx2015times.

(b) Letnegbe another atomic operation for negating aBooleanvariable’s cache value.

Ifxis initially0, give a Petri net representation of the following program and specify transition sequences which describe why the program may terminate withx= 0orx= 1in memory.

loadx negx storex

loadx negx storex

Hint: Without concurrency, the net for one half of the above program could be represented by

mx=0 load cx=0 neg cx=1 store mx=1

Problem 2: Boundedness and Termination

Give Petri netsNb∧t,Nb∧¬t,N¬b∧tandN¬b∧¬tsuch that

• Nb∧tis bounded and terminating • Nb∧¬tis bounded and not terminating

• N¬b∧tis unbounded and terminating • N¬b∧¬tis unbounded and not terminating.

If one of the Petri nets above does not exist, prove why that is the case.

(2)

Problem 3: Invariants for Mutual Exclusion

Recall the mutual exclusion protocol given in class:

pw1

t1

pcs1

t2

sem=1

sem=0

t01 pw2

pcs2

t02

As seen in class(0 1 0 1 2 1)T is an invariant used to prove no markingM with M(pcs1) = M(pcs2) = M(sem=0) = 1

is reachable.

Which invariants can be used to prove no markingM with justM(pcs1) = M(pcs2) = 1is reachable? Give a general description and prove mutual exclusion for such a concrete invariant.

Problem 4: “Multiplication” as a Petri Net

Consider the Petri net which contains placesx,yandoutas in the picture below.

x m

y n

additional places, transitions and arcs

out

Add places (and corresponding tokens), transitions and arcs to the net such that for arbitrary m, n∈N, ifM0(x) = m,M0(y) =nandM0(out) = 0the net always reaches a deadlock and, ifMter is the deadlock marking,Mter(out)isanyof{0, . . . , m·n}.

Argument the correctness of your construction.

Referenzen

ÄHNLICHE DOKUMENTE

As a key-bounding-box-value store (KBVS), BBoxDB stores each value together with an n-dimensional axis parallel bounding box. The bounding box describes the location of the value in

ça à Renée qui lui pouffe dans le cou en disant: «Tais-toi, tais-toi, je vais mourir.» Mais Agnès, elle, se bouche les oreilles en répétant: «Si tu crois que tu me fais peur avec

• Hierarchisches Caching: Anfrage wird bei einem Cache- Miss über mehrere Hierarchiestufen weitergereicht.

Übertragungszeit sinkt, wenn Objekte im (netztopologisch) nahen Cache gefunden werden.. Nicht gefundenen Objekte werden schneller

The present paper solves the above problem for system (1.1) by defining the notion of weak parameter-ellipticity and by proving an a priori estimate for the corresponding

We studied and compared the performance of MICP with other online and offline caching and prefetching algorithms via simulation and not analytically because the effects of

We shall now show that our algorithm is an extension of the modified method of centres ((Pironneau and Polak 19721, done in the spirit of (Lemarechal 1978)... The stepsize tk

As local improvement inside the VNS we use a Variable Neighborhood Descent (VND) iterating through six different neighborhoods: Swapping, Inserting, two variations of κ-Opt with