0% found this document useful (0 votes)
29 views

Previous Semester

The document is a midterm exam for an Operating Systems course consisting of 12 questions testing students' knowledge of scheduling algorithms, synchronization methods, and producer-consumer problems. Students are asked to draw scheduling diagrams for various processes using algorithms like priority scheduling, round robin, and shortest job first. They are also asked to suggest synchronization methods for scenarios involving shared resources like buffer space, theater ticket booking, and board games. The exam is worth a total of 15 marks and has 1 hour and 5 minutes allotted for completion.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Previous Semester

The document is a midterm exam for an Operating Systems course consisting of 12 questions testing students' knowledge of scheduling algorithms, synchronization methods, and producer-consumer problems. Students are asked to draw scheduling diagrams for various processes using algorithms like priority scheduling, round robin, and shortest job first. They are also asked to suggest synchronization methods for scenarios involving shared resources like buffer space, theater ticket booking, and board games. The exam is worth a total of 15 marks and has 1 hour and 5 minutes allotted for completion.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

27 August, 2020

EAST WEST UNIVERSITY


Department of Computer Science and Engineering
B.Sc. in Computer Science and Engineering Program
Mid II Examination, Summer 2020 Semester

Course: CSE 325 Operating Systems, Section-03


Instructor: Masiath Mubassira, Lecturer, CSE Department
Full Marks: 15
Time: 1 Hour 05 minutes

Note: There are FOUR questions, answer ALL of them. Course Outcome (CO), Cognitive Level
and Mark of each question are mentioned at the right margin.

1. Consider the following set of processes, with the length of the CPU burst given [CO3, C4,
in milliseconds: Marks: 05]

Process Burst Time Arrival Time Priority


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

Draw a graphical representation of the schedule of tasks that illustrate the


execution of these processes by using either non-preemptive or preemptive
priority scheduling. Explain your reasoning for choosing one of these
algorithms.

2. Consider the following set of processes, with the length of the CPU burst given [CO3, C4,
in milliseconds: Marks: 05]

Process Burst Time Arrival Time


P1 20 0
P2 5 1
P3 4 2
P4 2 3
P5 3 4

Draw a graphical representation of the schedule of tasks that illustrate the


execution of these processes by using either First Come First Serve (FCFS) or
Round Robin (RR). Explain your reasoning for choosing one of these
algorithms.

Page 1
27 August, 2020

3. Consider the following set of processes, with the length of the CPU burst given [CO3, C4,
in milliseconds: Marks: 05]

Process Burst Time Arrival Time


P1 10 0
P2 7 4
P3 4 2
P4 8 20
P5 3 25

Draw a graphical representation of the schedule of tasks that illustrate the


execution of these processes by using either Shortest Job First (SJF) or
Shortest Remaining Time First (SRTF). Explain your reasoning for choosing
one of these algorithms.

4. Consider the following set of processes, with the length of the CPU burst given
[CO2, C3,
in milliseconds:
Marks: 05]
Process Burst Time
P1 4
P2 7
P3 12
P4 8
P5 6

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5 at
time zero. Draw a graphical representation of the schedule of tasks that
illustrate the execution of these processes using Shortest Job First (SJF).What
is the waiting time and turnaround time of each process for SJF scheduling
algorithm?

5. Consider the following set of processes, with the length of the CPU burst given [CO2, C3,
in milliseconds: Marks: 05]

Process Burst Time Priority


P1 6 3
P2 3 1
P3 4 2
P4 5 4
P5 8 5

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, at
time zero. Draw a graphical representation of the schedule of tasks that illust-
rate the execution of these processes using non-preemptive priority scheduli-
ng algorithm. Also, find the waiting time and turnaround time of each process
for this algorithm.

Page 2
27 August, 2020

6. Consider the following set of processes, with the length of the CPU burst given [CO2, C3,
in milliseconds: Marks: 05]

Process Burst Time


P1 4
P2 7
P3 12
P4 8
P5 6

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5 at
time zero. Also consider a time quantum of 4.Draw a graphical representation
of the schedule of tasks that illustrate the execution of these processes using
Round Robin (RR). What is the waiting time and turnaround time of each
process for RR scheduling algorithm?

7. In producer-consumer problem, the variable counter is executed in micro-


instructions. Currently, there are 5 items inserted in the buffer by the [CO2, C3,
producer. Consumer did not start consuming any items yet. Now, when Marks:
producer inserted another item in the buffer and was about to update the 2.5]
counter variable, consumer interrupted and context switching occurred. After
consumer removed one item and decremented and updated the counter
variable successfully, producer was reallocated to CPU and can resume its
execution. Explain briefly what may occur due to this context switching.

8. In disabling interrupt synchronization method, a process must disable [CO2, C3,


interrupt just after entering a critical section and re-enable it just before Marks:
leaving it. In a uniprocessor system, a particular process disables interrupt 2.5]
after entering a critical section but does not re-enable it after leaving critical
section. Suggest what could occur if it is still disabled.

9. In strict alternation algorithm, the processes enter the critical section by


[CO2, C3,
taking turns. Suppose a system contains only a process P1 which enters a
Marks:
critical section and before leaving critical section, updates the turn variable
and therefore, enters the non-critical section. Suggest what could occur if 2.5]
this process P1 wants to enter the critical section again.

10. Tick-tack-toe, also known as noughts and crosses, is a game for two players, [CO2, C3,
X and O, who take turns marking the spaces in a 3X3 grid. The player who Marks:
succeeds in placing three of their marks in a horizontal, vertical, or diagonal 2.5]
row is the winner and the game is over. Suggest a synchronization method
for the above scenario. Explain your reasoning. [Your answer should be
within 5 sentences.]

11. Star Cineplex is the first multiplex cinema theatre in Bangladesh. It also gives [CO2, C3,
its viewers the facility to check available tickets and book shows via online Marks:
ticket booking system. When the program is run, it creates a certain number 2.5]
of threads that attempt to sell all available tickets. However, the program
needs to make sure that while booking the same show by various users, the

Page 3
27 August, 2020

total number of available seats are error free and there is not any data loss.
Suggest a synchronization method for the above scenario. Explain your
reasoning. [Your answer should be within 5 sentences.]

12. Snakes and ladders is an ancient board game with numbered, gridded [CO2, C3,
squares. A number of snakes and ladders are pictured on the board. The Marks:
object of the game is to navigate one’s piece according to die rolls, helped 2.5]
by climbing ladders but hindered by falling down snakes. The program for
this game assures that 2 players can play at a single round. The players play
in turns. However, if a player rolls a 1, he can roll the dice once again.
Suggest a synchronization method for the above scenario. Explain your
reasoning. [Your answer should be within 5 sentences.]

Page 4
27 August, 2020

Page 5
27 August, 2020

Page 6

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy