0% found this document useful (0 votes)
6 views3 pages

Numerical

The document consists of multiple scenarios involving process management and resource allocation using Banker’s algorithm, page replacement algorithms, and disk scheduling algorithms. It includes questions regarding resource matrices, safe states, page faults, and head movements for various algorithms. Each scenario presents a unique set of processes, resources, and requests that require analysis and calculations to determine outcomes.

Uploaded by

mrsadiqou
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Numerical

The document consists of multiple scenarios involving process management and resource allocation using Banker’s algorithm, page replacement algorithms, and disk scheduling algorithms. It includes questions regarding resource matrices, safe states, page faults, and head movements for various algorithms. Each scenario presents a unique set of processes, resources, and requests that require analysis and calculations to determine outcomes.

Uploaded by

mrsadiqou
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1) Consider a system with five processes: P 0, P1, P2, P3, P4 and four resource types: R1, R2, R3 and

R4. For
each process, the current allocation and the maximum required allocation are given by the Allocation
and Max matrices. The current available resources are given by the Available matrix.

Allocation Max Available


Process R1 R2 R3 R4 R1 R2 R3 R1 R2 R3
R4 R4
P0 0 0 1 2 0 0 1 2 1 5 2 0
P1 1 0 0 0 1 7 5 0
P2 1 3 5 4 2 3 5 6
P3 0 6 3 2 0 6 5 2
P4 0 0 1 4 0 6 5 6
Answer the following question using Banker’s algorithm:
i. Determine the total amount of recourses of each type.
ii. What will be the content of the need matrix?
iii. Is the system in safe? If yes, then what is safe sequence?
iv. If a request from P1 arrives for (0, 4, 2, 0), can the request be granted.

2) Consider a system with five processes: P0, P1, P2, P3, P4 and three resource types: A, B and C. For each
process, the current allocation and the maximum required allocation are given by the Allocation and
Max matrices. The current available resources are given by the Available matrix.

Allocation Max Available


Process A B C A B C A B C

P0 1 1 2 4 3 3 2 1 0
P1 2 1 2 3 2 2
P2 4 0 1 9 0 2
P3 0 2 0 7 5 3
P4 1 1 2 11 2 3
Answer the following question using Banker’s algorithm:
i. Determine the total amount of recourses of each type.
ii. What will be the content of the need matrix?
iii. Determine if this state is “safe” using safety algorithm.
iv. If a request from P1 arrives for (1, 1, 0), can the request be granted.

3) Consider the following snapshot of a system:

Allocation Max Available


Process A B C A B C A B C
P0 0 1 0 7 5 3 3 3 2
P1 2 0 0 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
Answer the following question using Banker’s algorithm:
i. What will be the content of the need matrix?
ii. Is the system in a safe state? If yes, then what is the safe sequence?
iii. If a request from P1 arrives for (1, 0, 2), can the request be granted.

4) Consider the following snapshot of a system:

Allocation Max Available


Process A B C A B C A B C

P0 0 1 0 0 1 0 0 0 0
P1 2 0 0 4 0 2
P2 3 0 3 3 0 3
P3 2 1 1 3 1 1
P4 0 0 2 0 6 4
Answer the following question using Banker’s algorithm.
i. What will be the content of the need matrix?
ii. Is the system in a safe state? If yes, then what is the safe sequence?
iii. If a request from P1 arrives for (1, 0, 2), can the request be granted immediately.

5) Consider the following page references string

7 , 0 , 1 ,2 , 0 , 3 ,0 , 4 , 2, 3 , 0 , 3

How many page faults would occur for the following replace algorithms, assuming three frames?
(Remember that all frames are initially empty)

i. FIFO Replacement
ii. LRU Replacement
iii. Optimal Replacement

6) How many page faults would occur for the following page reference string, for four page frames using
FIFO, LRU and optimal page replacement algorithm? If the four frames are initially empty.

7 , 0 , 1 ,2 , 0 , 3 ,0 , 4 , 2, 3 , 0 , 3 ,1 , 2 ,0
7) How many page faults would occur for the following page reference string, for four-page frames using
FIFO, LRU and optimal page replacement algorithm? If the four frames are initially empty.

7 , 0 , 1 ,2 , 0 , 3 ,0 , 4 , 2, 3 , 0 , 3 ,2 , 1 ,2 , 0 , 1 ,7 , 0 , 1

8) How many page faults would occur for the following page reference string, for three-page frames using
FIFO, LRU and optimal page replacement algorithm? If the three frames are initially empty.

1 , 2, 3 , 4 ,2 , 1 ,5 , 6 , 2 ,1 , 2 ,3 , 7 , 6 , 3 ,2 , 1 ,2 , 3 , 6

9) A disk contains two hundred tracks numbered 0 to 199 is currently serving a request at track 50,
consider an ordered disk queue with requests involving track numbers
82 , 170 , 43 ,140 ,24 ,16 , 190

What is the total head movement to satisfy this request for the following disk scheduling algorithms?

i. FCFS
ii. SSTF
iii. C- SCAN (the disk arm is moving towards the largest value)
iv. LOOK
10) The head of a moving head disk with 200 tracks numbered 0 to 199 is currently serving a request at
track 143, consider an ordered disk queue with requests involving track numbers
86 , 147 , 91 , 177 , 94 , 150 ,102 , 175 ,130

What is the total head movement to satisfy this request for the following disk scheduling algorithms?

i. FCFS
ii. SSTF
iii. SCAN (the disk arm is moving towards the lowest value)

You might also like