Give examples of reusable and consumable resources.
Examples of resuable resources are processors, I/O channels,
and secondary memory, devices, and data structures
such as files,
semaphores. Examples of consumable
signals, messages, and information in I/O buffers.
What are the three conditions that most be present for
deadlock to be possible?
Mutual exclusion -
Only one process may use
a resource at a time.
and wait - A process may
allocated resources while awaiting
resource can be forcibly removed from a process
What are the four conditions that create deadlock?
above three conditions, plus:
Circular wait - A closed
such that each
process holds at least
one resource needed by the next process in the
How can the hold-and-wait condition be prevented?
hold-and-wait condition can
prevented by requiring that a
all of its
all requests can be
List two ways in which the no-preemption condition can be
denied a further
that process must release its original resources an, if necessary, request
resource that is
held by another
again together with
the additional resource. Alternatively, if a
may preempt the second
require it to
release its resources.
How can the circular wait condition be prevented?
cimulanwait condition can be prevented by defining a linear
If a process has
R, then it may
following R in the
Available = [2
2 0 0 11
Request = [1 0 1 0
9 1 0 0
0 0 1 01
Allation = [2
o 1 2 0
Deadlock Detection Algorithm:
Mark each process that has a row in the Allocation
matrix of all are.
Initialize a temproary vector W to equal the Available
Find an index i such that process i is currently un-
marked and eth row of Q is less than or equar to W. That
is, Qiic < Wk, for 1 < k •<, rn. if no such row is found
terminate the algorithm.
If such a row is found, mark process i and add the
corresponding row of the allocation matrix to W. That is,
set VW, = Wk Ai k, for 1 <
rn. Return to step c.
2100 + 0120 = 2220
v ' -First rove 2220 -I- 0010 = 2230
Setord row: 2230 -I- 2001 = 4231
Consider a system with a tohtal of 150 units of memory,
allocated to three processes as shown:
Apply the Banker's Algorithm
to determine whether it would be safe to grant each of the
following requests. If yes, indicate a sequence of termina-
tions that could be guaranteed possible. If no, show the
reduction of the resulting allocation table.