You are on page 1of 3

School of Science and Engineering

Semester Final Exam Semester: Summer 2021


Course Code: CSE 204 Course Title: Operating Systems
Section: 02 Course Teacher: MGK

Exam Date: 29 September 2021 Time: 2 Hours Full Marks: 40

General instructions:
Please read the following instructions carefully:
During the Exam:
1. This is an “open note” online assessment that allows the students to use any materials handed
out in the class, your notes from the lectures, and any other resource that I have already
shared with you on UHLC / Google Classroom;
2. The duration of the assessment is 1 Hour 45 minutes and an additional 15 minutes is allotted
for answer submission;
3. Show/present all the necessary steps/justifications to derive your answer, where applicable;
4. Showing or discussing anything related to the questions with anyone is prohibited. Hence,
usage of any online and offline messaging platforms and external/cloud storage are also
strictly prohibited. Further, online searches for preparing your answer are discouraged;
5. Plagiarism policy mentioned in the course outline will be followed;
6. During the entire assessment period, you are required to be online over google meet. (The
link will be the same as the link for regular classes);
7. You might be randomly asked to turn on your video during the assessment. Hence, please
ensure necessary arrangements to comply;
8. Please inform me immediately for any disruption via Telegram/mobile;
9. Even if you have Broadband connection in your home, please purchase sufficient internet
data on your smartphone to avoid any internet-related disruptions.

Script Submission:
1. You must write down your answers on Blank A4 papers;
2. Cover page – you must write your Name, ID, Course Code, Course Title, Section Number,
and “Final Assessment – Spring 2021”;
3. After completing writing answer, take pictures or scan your answer script. You may use any
scanning app for this purpose;
4. Your student ID should be your file name;
5. Make sure that your handwriting is readable;
6. Questions you are answering must have their numbers written correctly;
7. Make sure that your answer scripts are correctly numbered and sequenced;
8. Upload the PDF file on UHLC / Google Classroom within 15 minutes after the assessment is
complete;
9. Failure to submit the answers on time without any valid ground will be considered as late
submission. Marks will be deducted in such cases.

Page 1 of 3
School of Science and Engineering
Semester Final Exam Semester: Summer 2021
Course Code: CSE 204 Course Title: Operating Systems
Section: 02 Course Teacher: MGK

Exam Date: 29 September 2021 Time: 2 Hours Full Marks: 40

PLEASE ANSWER ALL QUESTIONS.

QUESTION 1
a) Discuss how larger time-quantum in CPU scheduling can reduce the context switching
overhead.
(5 Marks)
b) Discuss the usage of semaphore and how the ownership is achieved by the threads.
(6 Marks)

QUESTION 2
Let us say, two processes P1 and P2 tries to access to a critical section of a shared file. P1 process
calls read() operation to read and P2 process calls write() operation to write to the critical section
of the file simultaneously.
a) State the race condition considering the use case;
(6 Marks)
b) Discuss the use of atomic instructions that test and lock the processes to restrict to the critical
section.
(8 Marks)

QUESTION 3
Consider a system with three processes P1, P2 and P3, three resource types X (11 instances), Y
(14 instances) and Z (10 instances). The allocation and maximum need of the processes are listed
in the Table.

Process Allocation Maximum need Remaining need Available


resource
instances
X Y Z X Y Z X Y Z X Y Z
P1 3 4 2 6 7 5
P2 3 3 2 7 8 4
P3 2 2 3 4 6 4

If 3 instances of X, 5 instances of Y and 3 instances of Z are available at time T0 then apply the
Banker’s algorithm to allocate the required resource instances to the processes to complete their
execution. State the sequence of the processes that satisfies the safety criteria.
(5 Marks)

Page 2 of 3
QUESTION 4
Consider a system with five processes P1 through P5, Arrival time, Burst time and Priority stated
in the table.

Process Arrival Time Burst Time Priority


P1 0 7 5
P2 1 4 2
P3 2 8 1
P4 3 2 3
P5 4 3 4

a) Draw Gantt charts that illustrate the execution of the processes using preemptive Shortest Job
First and Round Robin (with time quantum = 3) scheduling algorithms.
(4 Marks)
b) Compare between the scheduling algorithms based on their average waiting time.
(6 Marks)

------------------------- Good Luck --------------------------------

Page 3 of 3

You might also like