• Keine Ergebnisse gefunden

Consider a simple message exchange protocol where two users exchange messages through a server. The code of the user (left side) and server (right side) may be described informally as:

N/A
N/A
Protected

Academic year: 2021

Aktie "Consider a simple message exchange protocol where two users exchange messages through a server. The code of the user (left side) and server (right side) may be described informally as:"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Concurrency Theory (WS 2010/11) Out: Mon, Oct 25 Due: Mon, Nov 1

Exercise Sheet 1

Jun.-Prof. Roland Meyer, Georgel C˘alin Technische Universit¨at Kaiserslautern

Problem 1: Message Exchange Protocol

Consider a simple message exchange protocol where two users exchange messages through a server. The code of the user (left side) and server (right side) may be described informally as:

loop either

send msg to server wait for ack or

receive msg from server end loop

loop

receive msg from User X

forward msg to User Y and send ack to User X end loop

Represent the system consisting of a server and two users by a Petri net. For each user, having a place denoting its “idle” state and a place denoting its “sending” state suffices. There are no additional places needed for the server.

Observe that the protocol has a bug, namely, if both users send a message the system reaches a deadlock. Give the firing sequence leading to this deadlock in the Petri net you suggested.

Propose and argument a possible fix for the above problem in the protocol and in its Petri net.

Problem 2: Shared Memory Concurrency

Consider the concurrent program P := P

1

||P

2

that uses the (initially set to 0) shared Boolean variable x:

x := 1 − x;

| {z }

programP1

|| x := 1 − x;

| {z }

programP2

Here, x := 1 − x is the result of the following two atomic operations:

• LOAD x to the local cache and perform x := 1 − x

• STORE x in main memory

Give the Petri net representations N

P1

and N

P

of the above programs. Note that places are needed for the 0 and 1 values of x in memory as well as in the caches of P

1

and P

2

.

Give a firing sequence which leads to the memory value of x being 1 after P ’s execution.

Argue how the size of N

P

is related to the sizes of N

P1

and N

P2

.

(2)

Problem 3: Boundedness and Termination

Give Petri nets N

b∧t

, N

b∧¬t

, N

¬b∧t

and N

¬b∧¬t

such that

• N

b∧t

is bounded and terminating • N

b∧¬t

is bounded and not terminating

• N

¬b∧t

is unbounded and terminating • N

¬b∧¬t

is unbounded and not terminating.

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

Problem 4: Reachability vs. Coverability

Give a Petri net with only three places and specify

• a marking M

c∧r

which is both coverable and reachable

• a marking M

c∧¬r

which is coverable but not reachable

• a marking M

¬c∧¬r

which is neither coverable nor reachable.

Prove that the markings you have chosen fulfill the demanded properties. How about M

¬c∧r

?

Referenzen

ÄHNLICHE DOKUMENTE

[r]

To access online help from the Driver Settings window, follow the instructions on page 20 to access the driver; then click the Help button at the bottom of the Driver Settings

The functional organization of one level of the cortex is governed by the interplay of earli- er and later representational stages of the sensory processing stream.. In mammals,

The main objective of the CultMark project is the development and implementation of innovative place (incorporating tourism) marketing strategies, based on the

The next time you turn on your computer after installing the driver, Windows 95 may display the New Hardware Found screen again.. In this case, click the Do not install a driver

At the wider level, relations between the United States and Iran continued to improve, causing some unease in western Gulf States, especially Saudi Arabia, but also allowing

Here my sense, especially if I look at what’s happening in Syria and Iraq right now, is we need to be able to maintain, for an organization like us, the ability to engage in

Turkey is one key partner to be considered: Turkey has a vital strategic partnership with Washington and has been part of the European Single Market through