Sunteți pe pagina 1din 2

BIRLA INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI

First Semester 2013-2014


Course Title: OPERATING SYSTEMS Course No: CS C372 /IS C362
MID SEM (Close Book) Date: 05-10-2013
Duration 90 Minutes MM: 35
______________________________________________________________________________
Q1) Consider a set of processes in which some of them are safety critical processes and other are
normal processes. Safety critical processes are identified with the help of safety bit. The safety
bit is 1 for the safety critical process and 0 for the normal process. These processes are placed
in two different queues depending on the type of process. Safety critical processes are inserted
in queue ‘Q1’ and normal processes are inserted in queue ‘Q2’. The CPU burst and arrival times
along with safety bit are mentioned below. The Queue Q1 has absolute priority over Q2 queue (
until Q1 queue is empty no process form Q2 queue will execute) . Both queues use round robin
scheduling with time quantum of 15. Whenever a process from Q2 queue is executing and a
safety critical process comes into the systems, the executing process from Q2 queue is
preempted.

Process Burst Time Arrival Time Safety Bit


P1 45 0 0
P2 23 10 0
P3 51 15 0
P4 22 20 1
a) Draw the gant chart to show the schedule. Find out normalized turn-around time and average
waiting time for each process. TIME QUANTUM = 15 milliseconds.
b) Assume the given burst time represents the priority of the process based on which the
processes are executed. The processes having least burst time has highest priority. For the given
data , based on burst time and arrival time ( ignore safety bit information ), assuming
preemptive priority scheduling, draw the gant chart, calculate normalized turnaround time and
waiting time. [2*4]

Q2) A system is having 4 processes P1, P2 and P3. And P4 These processes belong to two
different groups named as GP1 and GP2. The group weightage is 0.5 for both groups
.The process P1 and P3 belong to GP1 and P2,P4 belong to GP2. The base priority
for the Processes P1, P2, P3 and P4 is 32, 34, 34 and 36 respectively. Assume all
processes are processor bound and are ready to run. The priorities are calculated after
every second and between two priority calculations 80 clock ticks are generated.

For this system using Fair share scheduling algorithm show the tabular representation of
process execution sequence for 5 seconds of execution.
[8]
Q3. In a system there are three processes named P , Q and R . When the system starts, the process P
executes once then process Q executes twice and after this process R executes twice. The
process R cannot execute until process Q has executed twice and process Q can not execute
until process P has executed once . Once process P has executed it cannot execute again until
the process Q and R habe executed twice . The restriction mentioned above allows the process
P,Q and R to execute in following manner

PQQRR PQQRR PQQRR

Write the pseudo code for process P,Q and R using counting semaphore . Apart from semaphore
do not use any other shared variable for process synchronization. All the three processes access
the critical section in mutually exclusive manner .

[10]

Q4 answer the following questions in brief.

a) List all the condition Under which, transition from running to ready state can occur ?
b) Why a transition from blocked suspended state to ready state is not allowed?
c) List the processor information required to be stored as part of context switch.
d) Why it is difficult to use disabling/ enabling of interrupt for process coordination?
e) List the 4 properties that a given solution for handling critical section should satisfy.
f) Give the names of two scheduling algorithms that can be lead to starvation
[1.5 *6]

****************

S-ar putea să vă placă și