# Help interpreting this deadlock question

I have this assignment question but I am a bit unsure how to go about answering it. The question is as follows and accompanied by the image below:

Three processes are competing for six resources labelled A to F as shown below.

Using a resource allocation graph, show the possibility of a deadlock in the implementation above.

I know how to do the graph but what I am struggling to understand is, do I take the Release(); methods into consideration or only the Get(); methods. And also, would P0() access resources A, B and C first or will each process run simultaneously meaning P0() access resource A, P1() access resource D and P2() access resource C, and then the second set of Get() methods are requested simultaneously? Lastly it does not specify how many instances (dots) are in each resource, is there any indication as to how to determine/go about working with this? As soon as I can clear up these misunderstandings I can draw the diagram

1. P0 obtains A and B.
2. P1 obtains D and E.
3. P2 obtains C and F.

At this point, we have reached deadlock, since P0 is waiting for P2 to release C, P1 is waiting for P0 to release B, and P2 is waiting P1 to release D.

• Thank you, looks like that confirms what I was working towards :) Sep 1 '15 at 17:56

## Introduction

Consider a Petri Net model of the three processes. Assume the following:

1. Every resource (A, B, C, D, E, F) has one unit only.
2. All three processes run on a single processor. The processor can execute one and only one process at a time. This means that if a process is executing its Get() or Release() function or critical region, no other process can execute.
3. After executing a statement in any process (such as Get(), a statement in the critical section or Release()), the operating system can switch to another process and execute the other process’ next statement.

## Petri Net: Model and Sub-Models

Figure 1 is a Petri Net model of Process 1. Figure 2 is a Petri model of Process 2. Figure 3 is a Petri Net model of Process 3. Figure 4 is a Petri Net model of all processes.