💻

Operating System MCQs

1K+ questions with answers

151

The program follows to use a shared binary semaphore T. Process A int Y; A1: Y = X*2; A2: X = Y; signal(T); Process B int Z; B1: wait(T); B2: Z = X+1; X = Z;

a one
b two
c three
d four
Medium
View Details →
152

Semaphores are mostly used to implement ____________

a System calls
b IPC mechanisms
c System protection
d None of the mentioned
Medium
View Details →
153

Spinlocks are intended to provide __________ only.

a Mutual Exclusion
b Bounded Waiting
c Aging
d Progress
Medium
View Details →
154

The bounded buffer problem is also known as ____________

a Readers – Writers problem
b Dining – Philosophers problem
c Producer – Consumer problem
d None of the mentioned
Medium
View Details →
155

In the bounded buffer problem, there are the empty and full semaphores that ____________

a count the number of empty and full buffers
b count the number of empty and full memory spaces
c count the number of empty and full queues
d none of the mentioned
Medium
View Details →
156

In the bounded buffer problem ____________

a there is only one buffer
b there are n buffers ( n being greater than one but finite)
c there are infinite buffers
d the buffer size is bounded
Medium
View Details →
157

To ensure difficulties do not arise in the readers – writers problem _______ are given exclusive access to the shared object.

a readers
b writers
c readers and writers
d none of the mentioned
Medium
View Details →
158

The dining – philosophers problem will occur in case of ____________

a 5 philosophers and 5 chopsticks
b 4 philosophers and 5 chopsticks
c 3 philosophers and 5 chopsticks
d 6 philosophers and 5 chopsticks
Medium
View Details →
159

A deadlock free solution to the dining philosophers problem ____________

a necessarily eliminates the possibility of starvation
b does not necessarily eliminate the possibility of starvation
c eliminates any possibility of any kind of problem further
d none of the mentioned
Medium
View Details →
160

Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned. (GATE 2010) Method used by P1 : while(S1==S2); Critical section S1 = S2; Method used by P2 : while(S1!=S2); Critical section S2 = not(S1);

a Mutual exclusion but not progress
b Progress but not mutual exclusion
c Neither mutual exclusion nor progress
d Both mutual exclusion and progress
Medium
View Details →
161

A monitor is a type of ____________

a semaphore
b low level synchronization construct
c high level synchronization construct
d none of the mentioned
Medium
View Details →
162

A monitor is characterized by ____________

a a set of programmer defined operators
b an identifier
c the number of variables in it
d all of the mentioned
Medium
View Details →
163

A procedure defined within a ________ can access only those variables declared locally within the _______ and its formal parameters.

a process, semaphore
b process, monitor
c semaphore, semaphore
d monitor, monitor
Medium
View Details →
164

The monitor construct ensures that ____________

a only one process can be active at a time within the monitor
b n number of processes can be active at a time within the monitor (n being greater than 1)
c the queue has only one process in it at a time
d all of the mentioned
Medium
View Details →
165

What are the operations that can be invoked on a condition variable?

a wait & signal
b hold & wait
c signal & hold
d continue & signal
Medium
View Details →
166

Which is the process of invoking the wait operation?

a suspended until another process invokes the signal operation
b waiting for another process to complete before it can itself call the signal operation
c stopped until the next process in the queue finishes execution
d none of the mentioned
Medium
View Details →
167

A collection of instructions that performs a single logical function is called ____________

a transaction
b operation
c function
d all of the mentioned
Medium
View Details →
168

A terminated transaction that has completed its execution successfully is ____________ otherwise it is __________

a committed, destroyed
b aborted, destroyed
c committed, aborted
d none of the mentioned
Medium
View Details →
169

The state of the data accessed by an aborted transaction must be restored to what it was just before the transaction started executing. This restoration is known as ________ of transaction.

a safety
b protection
c roll – back
d revert – back
Medium
View Details →
170

Write ahead logging is a way ____________

a to ensure atomicity
b to keep data consistent
c that records data on stable storage
d all of the mentioned
Medium
View Details →
171

In the write ahead logging a _____________ is maintained.

a a memory
b a system
c a disk
d a log record
Medium
View Details →
172

An actual update is not allowed to a data item ____________

a before the corresponding log record is written out to stable storage
b after the corresponding log record is written out to stable storage
c until the whole log record has been checked for inconsistencies
d all of the mentioned
Medium
View Details →
173

The system periodically performs checkpoints that consists of the following operation(s) ____________

a Putting all the log records currently in main memory onto stable storage
b putting all modified data residing in main memory onto stable storage
c putting a log record onto stable storage
d all of the mentioned
Medium
View Details →
174

Consider a transaction T1 that committed prior to checkpoint. The <T1 commits> record appears in the log before the <checkpoint> record. Any modifications made by T1 must have been written to the stable storage either with the checkpoint or prior to it. Thus at recovery time ____________

a There is a need to perform an undo operation on T1
b There is a need to perform a redo operation on T1
c There is no need to perform an undo and redo operation on T1
d All of the mentioned
Medium
View Details →
175

Serializable schedules are ones where ____________

a concurrent execution of transactions is equivalent to the transactions executed serially
b the transactions can be carried out one after the other
c a valid result occurs after execution transactions
d none of the mentioned
Medium
View Details →
176

A locking protocol is one that ____________

a governs how locks are acquired
b governs how locks are released
c governs how locks are acquired and released
d none of the mentioned
Medium
View Details →
177

The two phase locking protocol consists of ____________

a growing & shrinking phase
b shrinking & creation phase
c creation & growing phase
d destruction & creation phase
Medium
View Details →
178

The shrinking phase is a phase in which?

a A transaction may obtain locks, but does not release any
b A transaction may obtain locks, and releases a few or all of them
c A transaction may release locks, but does not obtain any new locks
d A transaction may release locks, and does obtain new locks
Medium
View Details →
179

Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock? I) 2-phase locking II) Timestamp ordering

a I only
b II only
c Both I and II
d Neither I nor II
Medium
View Details →
180

What is a reusable resource?

a that can be used by one process at a time and is not depleted by that use
b that can be used by more than one process at a time
c that can be shared between various threads
d none of the mentioned
Medium
View Details →
181

Which of the following condition is required for a deadlock to be possible?

a mutual exclusion
b a process may hold allocated resources while awaiting assignment of other resources
c no resource can be forcibly removed from a process holding it
d all of the mentioned
Medium
View Details →
182

A system is in the safe state if ____________

a the system can allocate resources to each process in some order and still avoid a deadlock
b there exist a safe sequence
c all of the mentioned
d none of the mentioned
Medium
View Details →
183

The circular wait condition can be prevented by ____________

a defining a linear ordering of resource types
b using thread
c using pipes
d all of the mentioned
Medium
View Details →
184

Which one of the following is the deadlock avoidance algorithm?

a banker’s algorithm
b round-robin algorithm
c elevator algorithm
d karn’s algorithm
Medium
View Details →
185

What is the drawback of banker’s algorithm?

a in advance processes rarely know how much resource they will need
b the number of processes changes as time progresses
c resource once available can disappear
d all of the mentioned
Medium
View Details →
186

A problem encountered in multitasking when a process is perpetually denied necessary resources is called ____________

a deadlock
b starvation
c inversion
d aging
Medium
View Details →
187

Which one of the following is a visual ( mathematical ) way to determine the deadlock occurrence?

a resource allocation graph
b starvation graph
c inversion graph
d none of the mentioned
Medium
View Details →
188

To avoid deadlock ____________

a there must be a fixed number of resources to allocate
b resource allocation must be done only once
c all deadlocked processes must be aborted
d inversion technique can be used
Medium
View Details →
189

The number of resources requested by a process ____________

a must always be less than the total number of resources available in the system
b must always be equal to the total number of resources available in the system
c must not exceed the total number of resources available in the system
d must exceed the total number of resources available in the system
Medium
View Details →
190

The request and release of resources are ___________

a command line statements
b interrupts
c system calls
d special programs
Medium
View Details →
191

What are Multithreaded programs?

a lesser prone to deadlocks
b more prone to deadlocks
c not at all prone to deadlocks
d none of the mentioned
Medium
View Details →
192

For a deadlock to arise, which of the following conditions must hold simultaneously?

a Mutual exclusion
b No preemption
c Hold and wait
d All of the mentioned
Medium
View Details →
193

For Mutual exclusion to prevail in the system ____________

a at least one resource must be held in a non sharable mode
b the processor must be a uniprocessor rather than a multiprocessor
c there must be at least one resource in a sharable mode
d all of the mentioned
Medium
View Details →
194

For a Hold and wait condition to prevail ____________

a A process must be not be holding a resource, but waiting for one to be freed, and then request to acquire it
b A process must be holding at least one resource and waiting to acquire additional resources that are being held by other p
c A process must hold at least one resource and not be waiting to acquire additional resources
d None of the mentioned
Medium
View Details →
195

For non sharable resources like a printer, mutual exclusion ____________

a must exist
b must not exist
c may exist
d none of the mentioned
Medium
View Details →
196

For sharable resources, mutual exclusion ____________

a is required
b is not required
c may be or may not be required
d none of the mentioned
Medium
View Details →
197

To ensure that the hold and wait condition never occurs in the system, it must be ensured that ____________

a whenever a resource is requested by a process, it is not holding any other resources
b each process must request and be allocated all its resources before it begins its execution
c a process can request resources only when it has none
d all of the mentioned
Medium
View Details →
198

The disadvantage of a process being allocated all its resources before beginning its execution is ____________

a Low CPU utilization
b Low resource utilization
c Very high resource utilization
d None of the mentioned
Medium
View Details →
199

To ensure no preemption, if a process is holding some resources and requests another resource that cannot be immediately allocated to it ____________

a then the process waits for the resources be allocated to it
b the process keeps sending requests until the resource is allocated to it
c the process resumes execution without the resource being allocated to it
d then all resources currently being held are preempted
Medium
View Details →
200

One way to ensure that the circular wait condition never holds is to ____________

a impose a total ordering of all resource types and to determine whether one precedes another in the ordering
b to never let a process acquire resources that are held by other processes
c to let a process wait for only one resource at a time
d all of the mentioned
Medium
View Details →