CMPE-320 OPERATING SYSTEMS FINAL
QUESTIONS
______ scheduling is approximated by predicting the next CPU burst with an
exponential average of the measured lengths of previous CPU bursts - Answer -
multilevel queue
Which of the following alogrithhms is non preemptive - Answer -FCFS
In Little's formula, λ represents - Answer -avereage arrival rate for new processes
The _____ occurs in first come first served scheduling when a process with a long cpu
burst occupies the CPU. - Answer -convoy effect
A deadlocked state occurs whenver - Answer -Every process in a set is waiting for an
event that can only be casued by anotehr process in the set.
One necessary condition for deadlock is ______ which states that a process must be
holding one resource and waiting to acquire additional resources - Answer -hold and
wait
One necessary condition for deadlock is _____ which states that a resource can be
released only voluntarily by the process hold the resource - Answer -No preemption
Which of the following statements is true? - Answer -An unsafe state may lead to a
deadlocked state
Suppose that there are 12 resources available to three processes. At time 0, the
following data is collected. The table indicates the process, the maximum number of
resources needed by the process, and the number of resources currently owned by
each process. Which of the following correctly characterizes this state - Answer -It is
currently safe
_____ is the dynamic storage-allocation algorithm which results in teh smallest leftover
hole in memory - Answer -Best fit
true or false: Mutex locks and counting semaphores are essentially the same thing -
Answer -false
true or false: round robin scheduling degenerates to first come first seved scheduling if
the time quantum is too long - Answer -true
true or false: the circular wait condition for a deadlock implies the hold and wait
condition - Answer -true
, true or false: The bankers algorithm is useful in a system with multiple instances of each
resource type - Answer -true
What are the advantages of EDF scheduling algorithm over the rate-monotonic
scheduling algorihtm - Answer -No need to define priotires offline, it has less context
swithcing rather than rate monotonic, it utilizes the process maximum up to 100%
utilizaiton compared to rate monotonic
Describe the gour conditions that must hold simultaneously in a system if a deadlock is
to occur - Answer -hold and wait: process is holding resources and is waiting on other
resources
circular wait: P1 holds resources that P2 needs but wont release because it is waiting
on resources that p2 has
no preemption: The process does not correctly release resources by entering wait or
termination
mutual exclusion: processes attempt to access critical section at same time and cant
because they cant have lock
What is one way to ensure that a circular wait condition does not occur? - Answer -Ibe
way to ensure that this condition never holds is to impose a total ordering of all resource
types and to require that each process requests resources in an increasing order of
enumeration. This can be accomplished by assigning each resource type a unique
integer number to determine where one precedes another in ordering.
Name three issues that need to be addressed if a preemption is required to deal with
deadlocks - Answer -First, order resources and process that need to be preempted and
must be determined to minimize cost
Second, if a resouce is preempted from a process, process must be rolled back to some
safe state and restarted from that state
finally we must ensure that starvation does not occur from always preempting resources
from same process
When does external fragmentation occur - Answer -When there is enough room for a
prcoess to be stored however this room is broken apart by an occupied space of
another process. Suppose you have a process that needs 8mb, you have 2 4mb slots
seperated. you have enough space but cannot store it because it is broken apart.
Consider three processes p1, p2, and p3 where the processesing times are t1 =15, t2 =
15, t3 = 10 and the periods are p1 = 30 p2 = 40, p3 = 50.. Can these three processes
be scheduled using EDF? - Answer -Take each time and divide it by its corresponding
p. t/p and then add all the answers up. Then use a gantt chart showing in order who has
the EDF and completing the job
Given six memory partitions of 300 KB , 600 KB , 350 KB , 200 KB , 750 KB ,
and 125 KB (in order), how would the first-fit, best-fit, and worst-fit
QUESTIONS
______ scheduling is approximated by predicting the next CPU burst with an
exponential average of the measured lengths of previous CPU bursts - Answer -
multilevel queue
Which of the following alogrithhms is non preemptive - Answer -FCFS
In Little's formula, λ represents - Answer -avereage arrival rate for new processes
The _____ occurs in first come first served scheduling when a process with a long cpu
burst occupies the CPU. - Answer -convoy effect
A deadlocked state occurs whenver - Answer -Every process in a set is waiting for an
event that can only be casued by anotehr process in the set.
One necessary condition for deadlock is ______ which states that a process must be
holding one resource and waiting to acquire additional resources - Answer -hold and
wait
One necessary condition for deadlock is _____ which states that a resource can be
released only voluntarily by the process hold the resource - Answer -No preemption
Which of the following statements is true? - Answer -An unsafe state may lead to a
deadlocked state
Suppose that there are 12 resources available to three processes. At time 0, the
following data is collected. The table indicates the process, the maximum number of
resources needed by the process, and the number of resources currently owned by
each process. Which of the following correctly characterizes this state - Answer -It is
currently safe
_____ is the dynamic storage-allocation algorithm which results in teh smallest leftover
hole in memory - Answer -Best fit
true or false: Mutex locks and counting semaphores are essentially the same thing -
Answer -false
true or false: round robin scheduling degenerates to first come first seved scheduling if
the time quantum is too long - Answer -true
true or false: the circular wait condition for a deadlock implies the hold and wait
condition - Answer -true
, true or false: The bankers algorithm is useful in a system with multiple instances of each
resource type - Answer -true
What are the advantages of EDF scheduling algorithm over the rate-monotonic
scheduling algorihtm - Answer -No need to define priotires offline, it has less context
swithcing rather than rate monotonic, it utilizes the process maximum up to 100%
utilizaiton compared to rate monotonic
Describe the gour conditions that must hold simultaneously in a system if a deadlock is
to occur - Answer -hold and wait: process is holding resources and is waiting on other
resources
circular wait: P1 holds resources that P2 needs but wont release because it is waiting
on resources that p2 has
no preemption: The process does not correctly release resources by entering wait or
termination
mutual exclusion: processes attempt to access critical section at same time and cant
because they cant have lock
What is one way to ensure that a circular wait condition does not occur? - Answer -Ibe
way to ensure that this condition never holds is to impose a total ordering of all resource
types and to require that each process requests resources in an increasing order of
enumeration. This can be accomplished by assigning each resource type a unique
integer number to determine where one precedes another in ordering.
Name three issues that need to be addressed if a preemption is required to deal with
deadlocks - Answer -First, order resources and process that need to be preempted and
must be determined to minimize cost
Second, if a resouce is preempted from a process, process must be rolled back to some
safe state and restarted from that state
finally we must ensure that starvation does not occur from always preempting resources
from same process
When does external fragmentation occur - Answer -When there is enough room for a
prcoess to be stored however this room is broken apart by an occupied space of
another process. Suppose you have a process that needs 8mb, you have 2 4mb slots
seperated. you have enough space but cannot store it because it is broken apart.
Consider three processes p1, p2, and p3 where the processesing times are t1 =15, t2 =
15, t3 = 10 and the periods are p1 = 30 p2 = 40, p3 = 50.. Can these three processes
be scheduled using EDF? - Answer -Take each time and divide it by its corresponding
p. t/p and then add all the answers up. Then use a gantt chart showing in order who has
the EDF and completing the job
Given six memory partitions of 300 KB , 600 KB , 350 KB , 200 KB , 750 KB ,
and 125 KB (in order), how would the first-fit, best-fit, and worst-fit