You are on page 1of 3

Alexandria University

Faculty of Engineering
Specialized Scientific Programs
Spring 2015

CSE373: Operating Systems


Term 6
Sheet 4
Due: Wednesday, May 20th, 2015

Chapter 7: Deadlocks
Q.1. (7.3) Consider the following snapshot of a system:

Answer the following questions using the bankers algorithm:


a. What is the content of the matrix Need?
b. Is the system in a safe state?
c. If a request from process P1 arrives for (0, 4, 2, 0), can the request be granted
immediately?
Q.2. (7.22) Consider the following snapshot of a system:

Using the bankers algorithm, determine whether or not each of the following states is unsafe.
If the state is safe, illustrate the order in which the processes may complete. Otherwise,
illustrate why the state is unsafe.
a. Available = (0, 3, 0, 1)
b. Available = (1, 0, 0, 2)

Dr. Yousry Taha


Dr. Hisham M. Sueyllam

Page 1 of 3

Eng. Ahmed Hamdy

Alexandria University
Faculty of Engineering
Specialized Scientific Programs
Spring 2015

CSE373: Operating Systems


Term 6
Sheet 4
Due: Wednesday, May 20th, 2015

Q.3. (7.23) Consider the following snapshot of a system:

Answer the following questions using the bankers algorithm:


a. Illustrate that the system is in a safe state by demonstrating an order in which the
processes may complete.
b. If a request from process P1 arrives for (1, 1, 0, 0), can the request be granted
immediately?
c. If a request from process P4 arrives for (0, 0, 2, 0), can the request be granted
immediately?
Q.4. (7.11) [Just think about it. Enjoy] Consider the traffic deadlock depicted in the Figure.
a. Show that the four necessary conditions for deadlock hold in this example.
b. State a simple rule for avoiding deadlocks in this system.

Dr. Yousry Taha


Dr. Hisham M. Sueyllam

Page 2 of 3

Eng. Ahmed Hamdy

Alexandria University
Faculty of Engineering
Specialized Scientific Programs
Spring 2015

CSE373: Operating Systems


Term 6
Sheet 4
Due: Wednesday, May 20th, 2015

Delivery:
Due to on Wednesday, May 20th, 2015.
Send your solution (attached, no drop box links!) by email to
operating.systems.ssp@gmail.com with a subject [Sheet4] ID and write your name and
ID in the body of the email.
Ex: [Sheet4] 1526
An automated message will be sent to you if and only if you sent the sheet in the correct
way.
No hardcopy will be accepted
No late submission

Good Luck

Dr. Yousry Taha


Dr. Hisham M. Sueyllam

Page 3 of 3

Eng. Ahmed Hamdy

You might also like