Osg202 Lab 4

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

16:19 29/02/2024 OSG202 LAB 4

SP24 OSG202 IA1807 P35


Classroom Mr Huy
Page 1 of 2

OSG202 LAB 4
Tin học Bộ môn • 26 Feb (Edited 27 Feb)
OSG202 – LAB 4
100 points Due Tomorrow, 23:59

Q1. What is a deadlock?


Complete the requirement in MS WORD. Save your solutions file name as: OSG202Lab4_StudentID_StudentName.docx
Q2. When a deadlock occurs, will the system remain in the deadlocked state
Ex: OSG202Lab4_He180111_VuVanHuy.docx
permanently or just temporarily for a limited amount of time?

Q3. Can deadlock happen if there is only one process? Why?


Note that:
Q4. Students working at individual PCs in a computer laboratory send their files to be
One day late will result in 1 point deducted from your total score.
Your studentID and your name must printed
beby
ata the
server
topwhich spoolssolution
of your the files onfile.
its hard disk. Under what conditions may

a deadlock occur if the disk space for the print spool is limited? How may the deadlock

OSG202 LAB 4.pdf


be avoided?

PDF Q5. What is an unsafe state?

Q6. What is the weakness of the Banker algorithm?

Q7. What is the idea of spooling to prevent deadlocks?


Your work Q8. Consider the following snapshot of a system:
Assigned

Add or create Allocation Max


Processes
ABCDABCD
P0 3 0 1 4 5 1 1 7
Mark as Done
P1 2 2 1 0 3 2 1 1
P2 3 1 2 1 3 3 2 1
P3 0 5 1 0 4 6 1 2
P4 4 2 1 2 6 3 2 5
Private comments Using the banker’s algorithm, determine whether or not each of the following

Add comment to Tin học Bộ môn 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: (A,B,C,D) = (0,3,0,1)


Class comments
b. Available: (A,B,C,D) = (1,0,0,2)
Add a class comment
Q9. Consider the following snapshot of a system:

Allocation Max Available


Processes
ABCDABCDABCD
P0 2 0 0 1 4 2 1 2 3 3 2 1
P1 3 1 2 1 5 2 5 2
P2 2 1 0 3 2 3 1 6
P3 1 3 1 2 1 4 2 4
P4 1 4 3 2 3 6 6 5

huyvv10@fpt.edu.vn - 1 -

Page 2 of 2

Answer the following questions using the banker’s algorithms:

a. Illustrate that the system is in a safe state by demonstrating an order in which the

processes my complete.

b. If a reques from process P1 arrives for (1,1,0,0), can the request be granted

immediately?

c. If a reques from process P4 arrives for (0,0,2,0), can the request be granted

immediatel ?
https://classroom.google.com/u/1/c/NjQ2NzUxMzk2NjA4/a/NjQ2NzUxMzk2NjMz/details 1/1

You might also like