Slides for the Ph.D. jury Data June 2015 CITATIONS READS 0 128 - - PDF document

slides for the ph d jury
SMART_READER_LITE
LIVE PREVIEW

Slides for the Ph.D. jury Data June 2015 CITATIONS READS 0 128 - - PDF document

See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/278026905 Slides for the Ph.D. jury Data June 2015 CITATIONS READS 0 128 1 author: Fernando Tricas University of Zaragoza 56


slide-1
SLIDE 1

See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/278026905

Slides for the Ph.D. jury

Data · June 2015

CITATIONS READS

128

1 author: Some of the authors of this publication are also working on these related projects: Structural properties of Petri Nets and evolutionary algorithms View project Create new project "Structural based approaches for deadlock prevention in concurrent systems" View project Fernando Tricas University of Zaragoza

56 PUBLICATIONS 895 CITATIONS

SEE PROFILE

All content following this page was uploaded by Fernando Tricas on 11 June 2015.

The user has requested enhancement of the downloaded file.

slide-2
SLIDE 2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems

Fernando Tricas Garc´ ıa Director: Dr. Joaqu´ ın Ezpeleta Departamento de Inform´ atica e Ingenier´ ıa de Sistemas Universidad de Zaragoza

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.1/49

slide-3
SLIDE 3

Outline

  • Framework
  • Deadlock prevention in
✁ ✂
  • Deadlock avoidance in
✁ ✄
  • Parallel computation of siphons
  • Conclusions

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.2/49

slide-4
SLIDE 4

Objectives

  • Study of deadlock problems in Sequential

Resource Allocation Systems (RAS), concentrating on Flexible Manufacturing Systems.

  • Solving the deadlock avoidance and

prevention problems for less restrictive classes of systems, using:

  • Formal methods (Petri nets)
  • An structural approach
  • State equation
  • Structure of the Petri net

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.3/49

slide-5
SLIDE 5

Framework

  • Resource Allocation Systems (RAS)
  • A set of processes
  • A set of (reusable) resources
  • They have a concurrent nature

Objective: to con- trol the system so that no deadlock can occur

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.4/49

slide-6
SLIDE 6

What to do?

Real System Controller

  • The Ostrich

algorithm

  • Deadlock detection

and recovery

  • Deadlock avoidance
  • Deadlock prevention

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.5/49

slide-7
SLIDE 7

What to do?

Real System Controller

  • The Ostrich

algorithm

  • Deadlock detection

and recovery

  • Deadlock avoidance
  • Deadlock prevention

(PN) model

Deadlock avoidance algorithm Scheduler

....

Controller

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.5/49

slide-8
SLIDE 8

What to do?

Real System Controller

  • The Ostrich

algorithm

  • Deadlock detection

and recovery

  • Deadlock avoidance
  • Deadlock prevention

(PN) model

Deadlock avoidance algorithm Scheduler

....

Controller

(PN) model: system +

control Scheduler

....

Controller

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.5/49

slide-9
SLIDE 9

Different subclasses

  • Constraints on the process structure
  • Sequential/concurrent?

(S–RAS/NS–RAS)

  • On–line routing decisions?
  • Internal cyclic behavior (recirculation)?
  • Constraints on how resources are

acquired/released

  • One/several resources at each state ?
  • How are they acquired/released?
  • One/several types at a time?

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.6/49

slide-10
SLIDE 10

An example

M3

✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆

I1 O2 H2 H1 O1 I2 R2 R3 R1 M1 M4 M2 Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.7/49

slide-11
SLIDE 11

An example

M3

✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆

I1 O2 H2 H1 O1 I2 R2 R3 R1 M1 M4 M2

R1 M1+h1 M3+h1+h3 R2 M2+h2+h4

R3

inR1 inM1 inM3 inR2 inM2 inR3 raw finished

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.7/49

slide-12
SLIDE 12

An example

M3

✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆

I1 O2 H2 H1 O1 I2 R2 R3 R1 M1 M4 M2

R1 M1+h1 M3+h1+h3 R2 M2+h2+h4

R3

inR1 inM1 inM3 inR2 inM2 inR3 raw finished

h4 h2 h3 h1 raw R3 inR3 M2 R2 M3 M1 R1 inM2 inR2 inM3 inM1 inR1 finished T8 T1 T7 T6 T4 T4 T3 T2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.7/49

slide-13
SLIDE 13

An example

M3

✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✁ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ✄ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ☎ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆ ✆

I1 O2 H2 H1 O1 I2 R2 R3 R1 M1 M4 M2

P1R1 P1M1 P1M3 P1R2 P1M2 P2M4 P2R2 P2M3 P2R1 R1 M1 M3 R2 M2 M4 P1R3 P2R3 R3 P1_0 10 P2_0 8 h1 h3 h2 h4 T2 T3 T4 T4 T6 T7 T1 T14 T13 T12 T11 T10 T8 T9

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.7/49

slide-14
SLIDE 14

S4PR nets: a general class of S–RAS

Compositional definition RAS features PN model features

  • Processes
  • Sequential process nature
  • On–line routing decisions
  • No internal cycles
  • Process as a strongly connected sta-

te machine whose cycles contain the idle state.

  • Resources
  • Conservative use of resources
  • Multiple copies of each resource
  • Multiple types of resources
  • Free acquiring/releasing
  • Resources defined as SIP
  • Related weighted arcs

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.8/49

slide-15
SLIDE 15

Features of the model

  • Clear mapping between model structure and

system features

  • Minimal T–Semiflows

production sequences

  • Resource related Minimal P–Semiflows

Resource reusability

  • State places related minimal P–Semiflows

State of parts in the system

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.9/49

slide-16
SLIDE 16

Liveness analysis

We provide a Liveness analysis

  • Characterization of the problem
  • circular waits involving resources
  • Reformulation of this characterization in

terms of siphons

  • for deadlock prevention

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.10/49

slide-17
SLIDE 17

An example

P1_1 P1_2 P2_1 P2_2 R1 R2 P1_3 P1_0 100 P2_0 100 T7 T6 T5 T4 T1 T2 T3 _2 _2 _2

daVinci V2.1

#12:2P1_1+P2_1+R2 Markings of type 1 Markings of type 2 Markings of type 3 #16:2P1_2 #17:P1_1+P1_2+P2_1 #10:P1_1+P1_2+R2 #18:2P1_1+2P2_1 #5:2P1_1+2R2 #20:2P1_1+P1_3 #15:P1_1+R1+P1_3 #9:2R1+P1_3 #11:P1_2+P2_1+R1 #4:P1_2+R1+R2 #13:P1_1+2P2_1+R1 #6:P1_1+P2_1+R1+R2 #2:P1_1+R1+2R2 #19:2P2_1+P2_2 #14:P2_1+P2_2+R2 #7:2P2_1+2R1 #3:P2_1+2R1+R2 #1:2R1+2R2 #8:P2_2+2R2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.11/49

slide-18
SLIDE 18

Liveness: circular waits

Theorem Let

  • ✁✄✂
☎ ✆ ✝

,

=

  • ✞✠✟
✡ ✞✠☛ ✡ ✞ ☞ ✂ ✌ ✂ ✍ ✝

, be a marked

✎ ✏ ✞ ✑

. The net is non–live if and only if there exists a marking

☎ ✒ ✓ ✔ ✕ ✁✄✂ ☎ ✆ ✖

such that:

  • the set of

–process–enabled transitions is non–empty

  • each one of these transitions is

– resource–disabled.

P1_1 P1_2 P2_1 P2_2 R1 R2 P1_3 P1_0 99 P2_0 99 T7 T6 T5 T4 T1 T2 T3 _2 _2 _2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.12/49

slide-19
SLIDE 19

Liveness: circular waits

Theorem Let

  • ✁✄✂
☎ ✆ ✝

,

=

  • ✞✠✟
✡ ✞✠☛ ✡ ✞ ☞ ✂ ✌ ✂ ✍ ✝

, be a marked

✎ ✏ ✞ ✑

. The net is non–live if and only if there exists a marking

☎ ✒ ✓ ✔ ✕ ✁✄✂ ☎ ✆ ✖

such that:

  • the set of

–process–enabled transitions is non–empty

  • each one of these transitions is

– resource–disabled.

P1_1 P1_2 P2_1 P2_2 R1 R2 P1_3 P1_0 99 P2_0 99 T7 T6 T5 T4 T1 T2 T3 _2 _2 _2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.12/49

slide-20
SLIDE 20

Liveness: siphons

Theorem Let

  • ✁✄✂
☎ ✆ ✝

,

=

  • ✞✠✟
✡ ✞✠☛ ✡ ✞ ☞ ✂ ✌ ✂ ✍ ✝

, be a marked

✎ ✏ ✞ ✑

. The net is non–live if, and only if, there exists a marking

☎ ✒ ✓ ✔ ✕ ✁✄✂ ☎ ✆ ✖

, and a siphon

  • such that
☎ ✁ ✞✠☛ ✂ ✄ ☎

and the firing of each

– process–enabled transition is prevented by a set of resource places belonging to

  • .

1.

✞ ☞ ✆ ✞✠✟ ✒ ✞ ☞ ✡ ☛ ☞ ✒ ✟ ✌

such that

☎ ✁ ✟ ✂ ✍ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂

and

☎ ✁ ✌ ☞ ✝ ✞✠☛ ✂ ✄ ☎ ✓ ✔ ✆ ✕

; 2.

✞✠☛ ✆ ✞✠✖ ✒ ✗✙✘ ✚ ✡ ☎ ✁ ✖ ✂ ✆ ☎ ✓ ✔ ✆ ✕

;

P1_1 P1_2 P2_1 P2_2 R1 R2 P1_3 P1_0 99 P2_0 99 T7 T6 T5 T4 T1 T2 T3 _2 _2 _2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.13/49

slide-21
SLIDE 21

Liveness: siphons (improved)

Theorem Let

  • ✁✄✂
☎ ✆ ✝

,

=

  • ✞✠✟
✡ ✞✠☛ ✡ ✞ ☞ ✂ ✌ ✂ ✍ ✝

, be a marked

✎ ✏ ✞ ✑

. The net is non–live if, and

  • nly if, there exists a siphon
  • , and a mar-

king

☎ ✘ ✒ ✓ ✔ ✕ ✁✄✂ ☎ ✆ ✖

, such that: 1.

☎ ✘ ✁ ✞✠☛ ✂ ✄ ☎

. 2.

☎ ✘ ✁ ✞✠☛
✂ ✘ ✂ ✆ ☎

. 3.

✄ ✖ ✒ ✁ ✂ ✘ ✚

such that

☎ ✘ ✁ ✖ ✂ ✄ ☎

, the firing of each

☞ ✒ ✖ ✌

is prevented by a set of resource places belonging to

  • .

P1_1 P1_2 P2_1 P2_2 R1 R2 P1_3 P1_0 99 P2_0 99 T7 T6 T5 T4 T1 T2 T3 _2 _2 _2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.14/49

slide-22
SLIDE 22

Using these liveness characterizations

Deadlock problems bad siphons + bad markings Objective: Preventing bad states

  • Without computing the reachability set

Solution: potential reachability set approximation

  • Advantage: linear description
  • Drawback: spurious solutions
  • No bad makings in PRS

No bad markings in RS

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.15/49

slide-23
SLIDE 23

How to compute a bad siphon

If

is a bad marking, the following set of inequalities has a solution

✂✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁☎✁✄✝ ✁✆✁✄✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✞ ✄ ✖ ✒ ✞
✟ ✂ ✄ ☞ ✒ ✌ ✖ ✂ ✟✡✠ ☛ ☞✍✌ ✎ ✏ ✑ ✟ ✌ ✒ ✡ ✌ ☞ ✡✔✓ ✕ ✁ ✎ ✖ ✗ ✘✙ ✂✛✚ ✎ ✖ ✖ ✜✣✢✤ ☞ ✠ ✎ ✥ ✦ ✥★✧ ✟✡✠ ✍ ✡ ✞
  • ✞✠✟
✡ ✞ ✟ ✢ ✖✩ ✟ ☞✫✪ ☎ ✁ ✞✠☛ ✂ ✄ ☎ ✄ ☞ ✒ ✌
  • ✞✠✟
✌ ✂

being

✞✠✖ ✓ ✆ ✌ ☞ ✝ ✞ ☛ ✂ ☎ ✁ ✖ ✂ ☛ ✩ ✑ ✩ ✑ ☛ ☎ ✁ ✖ ✂✬✮✭ ✯ ✁ ✖ ✂ ✩ ✑ ✞ ✟ ✢✰ ✩ ✱ ✱ ✩ ✱ ✩ ✤ ✲ ✳ ✗ ✩ ✴ ✬ ✴ ✖ ✱ ✲ ✳ ✗ ✩ ✴ ✄ ✟ ✒ ✞ ☞ ✂ ✄ ☞ ✒ ✟ ✌
✟ ✌ ✂ ☎ ✁ ✟ ✂✬ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂✔✓ ✟✶✵ ☛ ✩ ✵ ✑ ✩ ✵ ✑ ☛ ✕ ☎ ✁ ✟ ✂ ✒ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂✔✓ ✕ ✖ ✬ ✕ ☎ ✆ ✁ ✟ ✂ ✒ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂✔✓ ✕ ✖ ✩ ✵ ✑ ☛ ✟✷✵ ✩ ✵ ✑ ✑ ✩ ✱ ✢✸ ✟ ✰ ✩ ✱ ✩ ✤ ✲ ✳ ✗ ✩ ✴ ✬ ✴ ✖ ✱ ✲ ✳ ✗ ✩ ✴ ✄ ☞ ✒ ✌
✟ ✌ ✂ ☞ ✵ ✎ ✏ ✑ ✹ ✥ ✚ ✩ ✵ ✑ ✍ ✡ ✌ ☞ ✝ ✞ ☞ ✡ ✓ ✕ ✒ ✩ ✑ ✄ ✖ ✒ ✞
✟ ✂ ✟✡✠ ✒ ✞ ☎ ✂ ✕ ✓ ✂ ✄ ☞ ✒ ✌
✟ ✌ ✂ ✩ ✑ ✒ ✞ ☎ ✂ ✕ ✓ ✂ ✄ ✟ ✒ ✞ ☞ ✂ ✄ ☞ ✒ ✟ ✌
✟ ✌ ✂ ✩ ✵ ✑ ✒ ✞ ☎ ✂ ✕ ✓

(0)

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.16/49

slide-24
SLIDE 24

How to compute a bad siphon

Let

✂ ☎ ✆ ✝

,

=

✟ ✡ ✞ ☛ ✡ ✞ ☞ ✂ ✌ ✂ ✍ ✝

, be a marked

✎ ✏ ✞ ✑

. If net is non–live, there exists a marking

☎ ✒
✔ ✕ ✁✄✂ ☎ ✆ ✖

, with

☎ ✁ ✞✠☛ ✂ ✄ ☎

, and a siphon

  • such that the

following system of inequalities has, at least, one solution with

✞✠✖ ✒ ✞✠☛ ✡ ✞ ☞ ✡ ✟✷✠ ✆ ☎ ✓

:

✂✁✄✁✄✁☎✁✄✁✄✁✆✁✆✝ ✁✄✁☎✁✄✁✄✁☎✁✄✁✄✞

maximize

☞ ✠ ✎ ✥ ✦ ✥★✧ ✟✡✠

such that

☎ ✆ ☎ ✆ ✓ ✍✂✁ ✄ ☎ ☛ ☎ ✂ ✄ ✒

Z Z

☎ ✆ ☎ ✝ ✎ ✪ ✱ ☞ ✩ ✞ ✕

Previous Slide

(0)

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.17/49

slide-25
SLIDE 25

We need more

Problems happen when ... Too many resources are used at the same time

P1_0 P2_1 P1_1 P1_2 P2_2 R1 R2 P2_0 T1 T2 T3 T4 T5 T6 _2 _2 _2 _2 P1_0 P2_1 P1_1 P1_2 P2_2 R1 R2 P2_0 T1 T2 T3 T4 T5 T6 _2 _2 _2 _2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.18/49

slide-26
SLIDE 26

We need more

Problems happen when ... Too many resources are used at the same time

P1_0 P2_1 P1_1 P1_2 P2_2 R1 R2 P2_0 T1 T2 T3 T4 T5 T6 _2 _2 _2 _2 _2 _2 _2 _2 _2 _2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.18/49

slide-27
SLIDE 27

Another point of view

Problems happen when ... Too many active processes

P1_0 P2_1 P1_1 P1_2 P2_2 R1 R2 P2_0 T1 T2 T3 T4 T5 T6 _2 _2 _2 _2 P1_0 P2_1 P1_1 P1_2 P2_2 R1 R2 P2_0 T1 T2 T3 T4 T5 T6 _2 _2 _2 _2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.19/49

slide-28
SLIDE 28

Another point of view

Problems happen when ... Too many active processes

P1_0 P2_1 P1_1 P1_2 P2_2 R1 R2 P2_0 T1 T2 T3 T4 T5 T6 _2 _2 _2 _2 P1_0 P2_1 P1_1 P1_2 P2_2 R1 R2 P2_0 PDS T1 T2 T3 T4 T5 T6 _2 _2 _2 _2

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.19/49

slide-29
SLIDE 29

Computing representative markings

✞ ✁ ✂ ✘ ✆

maximize

☞ ✵ ✎ ✘ ✚ ☎ ✁ ✟ ✂

s.t.

✂✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✁✆✝ ✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✁✄✁✆✁✄✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✁✄✁✆✁✆✞ ☎ ✆ ☎ ✆ ✓ ✍ ✁ ✄ ☎ ☛ ☎ ✂ ✄ ✒

Z Z

☎ ✆ ☎ ✝ ☎ ✁ ✞✠☛
✂ ✘ ✂ ✆ ☎ ☎ ✁ ✞ ☛ ✂ ✄ ☎ ✄ ☞ ✒ ✌
  • ✞✠✟
✌ ✂

being

✞✠✖ ✓ ✆ ✌ ☞ ✝ ✞ ☛ ✂ ☎ ✁ ✖ ✂ ☛ ✩ ✑ ✩ ✑ ☛ ☎ ✁ ✖ ✂ ✬ ✭ ✯ ✁ ✖ ✂ ✄ ✟ ✒
✂ ✄ ☞ ✒ ✟ ✌
✟ ✌ ✂ ☎ ✁ ✟ ✂ ✬ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂ ☛ ✩ ✵ ✑ ✩ ✵ ✑ ☛ ✕ ☎ ✁ ✟ ✂ ✒ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂ ✓ ✕ ✖✬ ✕ ☎ ✆ ✁ ✟ ✂ ✒ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂✔✓ ✕ ✖ ✄ ✟ ✒ ✞ ☞
✂ ✄ ☞ ✒ ✟ ✌
  • ✞✠✟
✌ ✂ ✩ ✵ ✑ ✆ ✕ ✄ ☞ ✒ ✌
  • ✞✠✟
✌ ✂ ☞ ✵ ✎ ✏ ✑ ✹ ✥ ✚ ✩ ✵ ✑ ✍ ✡ ✌ ☞ ✝ ✞ ☞ ✡ ✓ ✕ ✒ ✩ ✑ ✄ ☞ ✒ ✌
  • ✞✠✟
✌ ✂ ✩ ✑ ✒ ✞ ☎ ✂ ✕ ✓ ✄ ✟ ✒ ✞ ☞ ✂ ✄ ☞ ✒ ✟ ✌
  • ✞✠✟
✌ ✂ ✩ ✵ ✑ ✒ ✞ ☎ ✂ ✕ ✓

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.20/49

slide-30
SLIDE 30

Control place

Let

✂ ☎ ✆ ✝

,

=

✟ ✡ ✞ ☛ ✡ ✞ ☞ ✂ ✌ ✂ ✍ ✝

, be a non–live

✎ ✏ ✞ ✑

. Let

  • be a bad siphon,

and

✂ ✘

as in previous Definition. Then,

  • The associated
  • –resource place,
✖ ✘

, is defined by means of the addition of the following incidence matrix row and initial marking:

✁ ✖ ✘ ✂ ✌ ✂ ✆ ✒ ☞ ✠ ✎ ✂ ✄ ☎ ✆✞✝ ✟ ✁ ✖ ✂ ✁ ✍ ✁ ✖ ✂ ✌ ✂ ☎ ✆ ✠ ☎ ✁ ✖ ✘ ✂ ✆ ☎ ✆ ✁
✒ ✕ ✞
✂ ✘ ✓ ✕ ✖

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.21/49

slide-31
SLIDE 31

Computing representative markings

✘ ✆

minimize

☞ ✠ ✎ ✂ ✄ ☎ ☎ ✁ ✖ ✂

s.t.

✂✁✄✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✁✄✁✆✁✄✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✝ ✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✁✄✁✆✁✆✁✄✁✄✁☎✁✄✁✄✁☎✁✄✁✄✁✄✁☎✁✄✁✄✁✆✁✆✁✄✁✆✁✄✁✆✞ ☎ ✆ ☎ ✆ ✓ ✍ ✁ ✄ ☎ ☛ ☎ ✂ ✄ ✒

Z Z

☎ ✆ ☎ ✝ ☎ ✁ ✞✠☛
✂ ✘ ✂ ✆ ☎ ☎ ✁ ✞✠☛ ✂ ✄ ☎ ✄ ☞ ✒ ✌
✟ ✌ ✂

being

✞✠✖ ✓ ✆ ✌ ☞ ✝ ✞ ☛ ✂ ☎ ✁ ✖ ✂ ☛ ✩ ✑ ✩ ✑ ☛ ☎ ✁ ✖ ✂ ✬ ✭ ✯ ✁ ✖ ✂ ✄ ✟ ✒
✂ ✄ ☞ ✒ ✟ ✌
✟ ✌ ✂ ☎ ✁ ✟ ✂ ✬ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂ ☛ ✩ ✵ ✑ ✩ ✵ ✑ ☛ ✕ ☎ ✁ ✟ ✂ ✒ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂ ✓ ✕ ✖✬ ✕ ☎ ✆ ✁ ✟ ✂ ✒ ✎✑✏ ✒ ✁ ✟ ✂ ☞ ✂✔✓ ✕ ✖ ✄ ✟ ✒ ✞ ☞
✂ ✄ ☞ ✒ ✟ ✌
✟ ✌ ✂ ✩ ✵ ✑ ✆ ✕ ✄ ☞ ✒ ✌
  • ✞✠✟
✌ ✂ ☞ ✵ ✎ ✏ ✑ ✹ ✥ ✚ ✩ ✵ ✑ ✍ ✡ ✌ ☞ ✝ ✞ ☞ ✡ ✓ ✕ ✒ ✩ ✑ ✄ ☞ ✒ ✌
  • ✞✠✟
✌ ✂ ✩ ✑ ✒ ✞ ☎ ✂ ✕ ✓ ✄ ✟ ✒ ✞ ☞ ✂ ✄ ☞ ✒ ✟ ✌
✟ ✌ ✂ ✩ ✵ ✑ ✒ ✞ ☎ ✂ ✕ ✓

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.22/49

slide-32
SLIDE 32

Control places

Let

✂ ☎ ✆ ✝

,

=

✟ ✡ ✞ ☛ ✡ ✞ ☞ ✂ ✌ ✂ ✍ ✝

, be a non–live

✎ ✏ ✞ ✑

. Let

  • be a bad siphon,

and

as in previous Definition. Then,

  • The associated
  • –process place,
✖ ✘

, is defined by means of the addition of the following incidence matrix row and initial marking:

✁ ✖ ✘ ✂ ✌ ✂ ✆ ✒ ☞ ✠ ✎ ✂ ✄ ☎ ✍ ✁ ✖ ✂ ✌ ✂ ✂ ☎ ✆ ✠ ☎ ✁ ✖ ✘ ✂ ✆ ✞
✘ ✒ ✕

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.23/49

slide-33
SLIDE 33

Which one to use?

  • Using

–resource approach usually gives more permissive solutions But ...

  • Not always possible (sometimes the marking

is not acceptable) So ...

  • First try with resources, and if it fails use

processes

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.24/49

slide-34
SLIDE 34

So ... how to control?

No more D–deadlocked states

  • The control places can be seen as ‘virtual’

resources, which add generalized mutual exclusion properties.

  • The obtained system is a
✁ ✂
  • It is analyzable in the same terms as the
  • riginal

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.25/49

slide-35
SLIDE 35

Iterative process

An sketch of the algorithm 1. Compute a bad siphon 2. Compute the control place 3. Repeat Does it terminate?

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.26/49

slide-36
SLIDE 36

Controlling a system

RCP2D P1_1 P1_2 P2_1 P2_2 R1 R2 P1_3 P1_0 100 P2_0 100 RCP1D RCP3D RCP4D T7 T6 T5 T4 T1 T2 T3 _2 _2 _2 _2 _2 _2 _2 _2

daVinci V2.1

#16:2P1_2 #17:P1_1+P1_2+P2_1 #10:P1_1+P1_2+R2 #18:2P1_1+2P2_1 #12:2P1_1+P2_1+R2 #5:2P1_1+2R2 #20:2P1_1+P1_3 #15:P1_1+R1+P1_3 #9:2R1+P1_3 #11:P1_2+P2_1+R1 #4:P1_2+R1+R2 #13:P1_1+2P2_1+R1 #6:P1_1+P2_1+R1+R2 #2:P1_1+R1+2R2 #19:2P2_1+P2_2 #14:P2_1+P2_2+R2 #7:2P2_1+2R1 #8:P2_2+2R2 #3:P2_1+2R1+R2 #1:2R1+2R2 RCP2D RCP1D RCP3D RCP4D

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.27/49

slide-37
SLIDE 37

S4PR: Conclusions

Advantages:

  • More general than previous approaches
  • At least as permissive as others (more in

most cases)

  • It does not need siphon enumeration

Drawbacks:

  • Sub–optimal
  • It does not scale well (modification,

reconfiguration)

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.28/49

slide-38
SLIDE 38

More general systems

Objective: To eliminate the two main drawbacks

  • f the previous method:
  • No inner recirculation is allowed
  • The method is not adequate for frequent

modification/reconfiguration

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.29/49

slide-39
SLIDE 39

An avoidance perspective

We will be able to solve the problem for the most general class of S–RAS

  • Banker’s algorithm + knowledge about the

future

  • ‘On–line’ methods: computation time is

critical

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.30/49

slide-40
SLIDE 40

Banker’s algorithm

Banker We know more ...

M M1

1 M

Mk

k

R R1 Rk

k

Max(p)

P Pi

i

  • q

q1

1 q

qk

k

R R1 Rk

k

Alloc(q)

N N1

1 N

Nk

k

R R1 Rk

k

Max(q)

p

m m

q

w

m * w * p p1

1 p

pk

k

R R1 Rk

k

Alloc(p)

.

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.31/49

slide-41
SLIDE 41

Brief introduction

  • Given a state ... is it safe?
  • Looking for an ordering in the sequential

termination of the active processes

  • Sequential termination

processes can terminate supposing that the others do not move

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.32/49

slide-42
SLIDE 42

Banker’s like algorithms

active processes

Success := true While

☎✆ ✝

and Success loop Look for a process such that isTerminable If such a process exists Then Eliminate from , release resources Else Success := false End If End Loop return Success

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.33/49

slide-43
SLIDE 43

Banker’s like algorithms

active processes

Success := true While

☎✆ ✝

and Success loop Look for a process such that isTerminable If such a process exists Then Eliminate from , release resources Else Success := false End If End Loop return Success Different instances

  • f isTerminable

different policies

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.33/49

slide-44
SLIDE 44

Proposals

Two types of solutions:

  • A framework for defining ‘Bankers–like’

algorithms, based on bound functions of future needs (for each process state, computed off–line).

  • An algorithm based on dynamic path search

in the state machine modeling a process.

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.34/49

slide-45
SLIDE 45

Attaching information to states

Pi

  • p

m m

q

m * p1 pk R1 Rk

Alloc(p)

.

Max(p)

  • N1 Nk

R1 Rk S1 Sk R1 Rk

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.35/49

slide-46
SLIDE 46

A static approach

Classical Banker’s algorithm:

Each place has the multi–set of maximal needs of each type of resource, along all the processing states.

  • Just a multiset attached to each node

Global Look–Ahead

Each state place has attached the supremum of the resources needed along all the paths (composed of state places) joining it and the corresponding idle state place.

  • Only a multiset attached to each node (but with more

accurate information).

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.36/49

slide-47
SLIDE 47

A static approach (cont.)

Another polynomial version

Each place has associated the set of supremum corresponding to a fixed number of paths joining it and the corresponding idle state place.

  • A fixed number of multisets attached to each node

Partial Look–Ahead

Each state place has a multi–set associated for each simple path joining it and the corresponding idle state place, ensuring resources to follow such path.

  • A variable number of multisets attached to each node

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.37/49

slide-48
SLIDE 48

A Static approach (end)

  • Three polynomial approaches
  • The Banker’s algorithm
  • Global Look–Ahead
  • Fixed number of paths (in fact, several

methods ...)

  • One than can be non–polynomial
  • Partial Look–Ahead

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.38/49

slide-49
SLIDE 49

A dynamic approach

ForEach state place in the state machine If (available resources + resources used by the considered process

  • resources used by the place)
  • Then

Mark the place End If End loop isTerminable := a simple path of marked nodes exists joining the considered process and its corresponding idle state

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.39/49

slide-50
SLIDE 50

Some comparison

Two families

Future needs (static information)

Path searching Different solutions (different bound func- tions) Less permissive to (Banker’s like) maxi- mally permissive Polynomial/non-polynomial

(Banker’s-like) Maximally permissive so- lution Polynomial Remark: when the number of paths is polynomial we have two (Banker’s like) maximally permissive policies:

  • One based on static information
  • One based on a path marking and searching algorithm

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.40/49

slide-51
SLIDE 51

Results

  • The second approach is the most permissive

(Banker’s like)

  • The first one can be faster (in execution time)
  • Maybe try some of them? (in a hierarchical

way, since they do not permissive exclude each other)

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.41/49

slide-52
SLIDE 52

Computing siphons

  • Deadlock problems ... minimal siphons exist

with ‘bad’ markings

  • Other proposal use siphon enumeration

to solve the problem

  • Not all the minimal siphons are needed
  • Only siphons containing resources

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.42/49

slide-53
SLIDE 53

What is available?

Some methods are able to select which siphons are going to be computed (based on some places that they must contain).

  • Known methods have been evaluated to check if they

are adequate

  • The method proposed by Boer and Murata

[BoerMurata94] has been selected

  • A parallel implementation has been done, distributing

the computation among available processors.

  • Experimental measurement of the ‘speed–up’

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.43/49

slide-54
SLIDE 54

Computing process

R5 R9 R1 R2 R6 R3 R7 R4 R8 R5 R9 R1 R2 R6 R3 R7 R4 R8 R5 R9 R1 R2 R6 R3 R7 R4 R8 Merge Merge Merge Filter P1 P2 P3 P4 P1 P3 P1 forkR_i phil1Waiting_i philForkR_i philForkL_i forkL_i philEating_i T5_i T6_i T3_i T2_i T1_i

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.44/49

slide-55
SLIDE 55

Speed–Up

1 2 3 4 5 6 7 8 2 4 6 8 10 12 Speed Up Number of Processors Size 2 Size 4 Size 6 Size 8 Size 10 Size 12 Size 14 Size 16 Size 18

18 Philosophers:

  • Places: 90
  • Resources: 18
  • Arcs: 288
  • Transitions:90
  • Time 1: 16.05
  • Time 12: 2.07

————

  • Switched Ethernet
  • 12 Pentium III

(1GHz)

  • 256Mb of RAM
  • MPI

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.45/49

slide-56
SLIDE 56

Siphon computation in RAS: Conclusions

Results:

  • The selected method seems to be adequate

for the considered problems.

  • Parallelization clearly improves computation

times.

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.46/49

slide-57
SLIDE 57

Conclusion

  • Deadlock policies in S–RAS avoiding the

state explosion problem.

  • Two new classes of systems have been

introduced,

✁ ✂

y

✁ ✄

, adequate for the modelling and analysis of a wide set of RAS.

  • Analysis of properties
  • Liveness characterization

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.47/49

slide-58
SLIDE 58

Conclusions

  • Structural approach for deadlock prevention

and avoidance

  • Prevention
  • Siphons+integer programming+iterative

solution

  • Avoidance
  • A set of very efficient/permissive

solutions

  • Efficient computation of siphons for RAS

based on a parallel implementation

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.48/49

slide-59
SLIDE 59

The End

Thanks!

Deadlock analysis, prevention and avoidance in Sequential Resource Allocation Systems– p.49/49