HW6 Cse
HW6 Cse
Part I Long Answer Questions. Please provide your own responses to the
questions, using original wording, and refrain from directly copying information
from the lecture notes.
Question 1. (2 points) List three examples of deadlocks that are not related to a
computer system environment.
Question 6. (3 points)
Consider the following snapshot of a system:
Using the safety algorithm in the banker's algorithm, determine whether or not
each of the following states is unsafe. If the state is safe, illustrate the order in
which the threads may complete. Otherwise, illustrate why the state is unsafe.
a. Available = (0, 4, 1, 1)
b. Available = (2, 0, 0, 2)
Question 7. (3 points)
Consider the following snapshot of a system:
2
b. Is the system in a safe state? If yes, illustrate the order in which the threads
may complete. Otherwise, illustrate why the state is unsafe.
c. If a request from thread T1 arrives for (0, 4, 2, 0), can the request be granted
immediately?
d. If a request from thread T4 arrives for (0, 5, 2, 0), can the request be granted
immediately?
Question 8. (3 points)
Consider the following snapshot of a system:
Using the deadlock detection algorithm determine whether or not a deadlock exists
given the following available vector. If a deadlock does not exist, please give a
safe sequence. Otherwise, illustrate which threads are deadlocked.
a. Available = (0, 0, 2, 1)
b. Available = (1, 0, 0, 1)