You are on page 1of 1

Section II (8 points)

1. Assume that you have following processes, with all information as needed for CPU Scheduler.
Process Arrival Time CPU Burst Priority
P1 0 3 3
P2 4 6 2
P3 3 7 1
P4 7 4 1
P5 12 4 2
P6 15 6 3
Please solve one and only one of these following questions:
(Using last 2 digits of your Student ID modular (mod - chia lấy phần dư) 3. The result is the question you have to
solve. Example: last 2 digits is 21 à21 mod 3 = 0 à hence, you HAVE TO choose question 0)
0. Round Robin with q = 4.
1. Preemptive Priority.
2. Preemptive SJF (SRTF).
Draw grant chart, determine the waiting times for each process and the average waiting times.

2. Consider the following snapshot of a system with 4 types of resources: 9 A, 7 B, 8 C, 6 D.


Allocation Max
Process
A B C D A B C D
P1 1 2 3 1 4 4 5 1
P2 1 0 1 1 7 5 6 2
P3 1 1 3 1 3 2 5 1
P4 2 2 0 1 4 2 3 1
P5 0 2 0 1 7 4 5 2
Please answer these questions:
a. Calculate the Need matrix.
b. Is current state safe or unsafe? Why? (please show solving progress)

NOTE:
- Please show whole progress how you solve the problems.
- Only accepted hand-writing answer sheets.

- Cán bộ coi thi không được giải thích đề thi;


- Thí sinh không được phép sử dụng tài liệu.
- Ghi số của đề thi vào bài làm, nộp kèm theo bài làm trước khi rời phòng thi.

BM - ĐT - 01

You might also like