Font size
WorksheetsOperating System Quiz 2
Total questions: 35
Worksheet time: 25mins
Which of the following scheduling algorithms is non-preemptive? (GATE CS 2002)
Round Robin
First-In First-Out
Multilevel Queue Scheduling
Multilevel Queue Scheduling with Feedback
consider the 3 processes, P1, P2 and P3 shown in the table
The completion order of the 3 processes under the policies FCFS and RRS (round robin scheduling with CPU quantum of 2 time units) are
FCFS: P1, P2, P3 RR2: P1, P2, P3
FCFS: P1, P3, P2 RR2: P1, P3, P2
FCFS: P1, P2, P3 RR2: P1, P3, P2
FCFS: P1, P3, P2 RR2: P1, P2, P3
Consider the following table of arrival time and burst time for three processes P0, P1 and P2.
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?
5.0 ms
4.33 ms
6.33 ms
7.33 ms
Which of the following statements are true? (GATE CS 2010)
I. Shortest remaining time first scheduling may cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time
I only
I and III only
II and III only
I, II and III
An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:
What is the total waiting time for process P2?
5
15
40
55
Consider a set of n tasks with known runtimes r1,r2,.....rn to be run on a uniprocessor machine. Which of the following processor scheduling algorithms will result in the maximum throughput?.
Round Robin
Shortest-Job First
Highest-Response-Ratio-Next
First-Come-First-Served
In a operating system, the purpose of the stack is...
To store the return addresses of called functions
To keep the parameters of called functions
To store local variables
All of the above
The memory returned by a call to malloc comes from the...
data segment
heap segment
text segment
stack segment
Operating System is not responsible to manage all resources
True
False
The grouping of jobs that require similar resources
timesharing
serial processing
multiprogramming
batch processing
The operating system is a type of
system software
general purpose software
utility software
application software
Which is not in the PCB
Process state
resources needed
program counter
processor size
A signal sent by a hardware or software to CPU indicating that something needs attention
disturbance
interrupt
waiting
exclusion
FCFS is operates similar to a
stack
sorting algorithm
circle
queue
Which of the following statements is/are TRUE with respect to deadlocks?
Circular wait is a necessary condition for the formation of deadlock.
In a system where each resource has more than one instance, a cycle in its wait for graph indicates the presence of a deadlock.
If the current allocation of resources to processes leads the system to unsafe state, then deadlock will necessarily occur.
In the resource-allocation graph of a system, if every edge is an assignment edge, then the system is not in deadlock state.
Which of the following is a correct statement about memory management in Operating Systems?
Memory management is responsible for managing the execution of processes.
Memory management ensures that each process gets a fair share of CPU time.
Memory management is responsible for allocating and deallocating memory to processes.
Memory management is only required in multi-user operating systems.
What is the maximum number of instances a process can request in a system with 4 instances of a resource type?
1
2
3
4
Which of the following is not related to synchronization in Operating System?
Bounded Buffer problem
Readers-Writers problem
Dining Philosophers problem
Belady's Anomaly
What do device drivers do?
Allows the OS to communicate with hardware
Drives around the motherboard
Increases the amount of storage
How many applications can be processed by the CPU at a time?
1
2
3
Several
To access the services of the operating system, the interface is provided by the
Library
System calls
Assembly instructions
API
How many process states are there?
4
5
6
7
Select the different process queues:
New
Wait
Arrival
Job
Which of the following need not necessarily be saved on a context switch between processes?
General purpose registers
Program counter
Translation look-aside buffer
All of the above
The maximum number of processes that can be in Ready state for a computer system with n CPUs is
n
n^2
2^n
Independent of n
Explain the concept of a resource allocation graph in the context of deadlock in operating systems.
It is a graph that depicts the allocation of resources to processes and is used to identify and create deadlock.
It is a graph that depicts the allocation of resources to processes and is used to identify and prevent deadlock.
It is a graph that depicts the allocation of resources to processes and is used to identify and resolve deadlock.
It is a graph that depicts the allocation of resources to processes and is used to create and prevent deadlock.
What are the necessary conditions for deadlock to occur?
Unlimited resources, no mutual exclusion
Mutual exclusion, hold and wait, no preemption, and circular wait
Preemption of resources, circular exclusion
Limited resources, no hold and wait
Discuss one method for deadlock prevention in operating systems.
Restart the system
Use resource allocation graph
Increase the number of processes
Ignore the deadlock
Discuss one technique for deadlock recovery in operating systems.
Memory allocation
CPU scheduling
Process termination
Disk defragmentation
The strategy of allowing processes that are logically runnable to be temporarily suspended is called
preemptive scheduling
non preemptive scheduling
shortest job first
first come first served
Semaphores are used to solve
Deadlock
Mutual exclusion
Inter-process Communication
Messaging
Only the process executing the critical section is allowed access to the shared variable,all other processes should prevented from doing so until the completion of the critical section. This is often referred to as-
Mutual exclusion
semaphores
Deadlock
Interprocess communication
The portion of the process scheduler in an operating system that dispatches processes is concerned with ____________
assigning ready processes to CPU
assigning ready processes to waiting queue
assigning running processes to blocked queue
all of the mentioned
It is used to store information for immediate access by the CPU.
CPU
Main Memory
Input/Output Devices
Secondary Memory
