Os mcq-1
Os mcq-1
a) I only
b) I and III only
c) II and III only
d) I, II and III
Answer: d
Explanation: I) Shortest remaining time first scheduling is a preemptive version of shortest job
scheduling. It may cause starvation as shorter processes may keep coming and a long CPU burst
process never gets CPU.
II) Preemption may cause starvation. If priority based scheduling with preemption is used, then a low
priority process may never get CPU.
III) Round Robin Scheduling improves response time as all processes get CPU after a specified time.
151. Which is the most optimal scheduling algorithm?
a) FCFS – First come First served
b) SJF – Shortest Job First
c) RR – Round Robin
d) None of the mentioned
Answer: b
152. The real difficulty with SJF in short term scheduling is ____________
a) it is too good an algorithm
b) knowing the length of the next CPU request
c) it is too complex to understand
d) none of the mentioned
Answer: b
153. The FCFS algorithm is particularly troublesome for ____________
a) time sharing systems
b) multiprogramming systems
c) multiprocessor systems
d) operating systems
Answer: a
Explanation: In a time sharing system, each user needs to get a share of the CPU at regular intervals.
154. Consider the following set of processes, the length of the CPU burst time given in milliseconds.
Answer: a
155. Preemptive Shortest Job First scheduling is sometimes called ____________
a) Fast SJF scheduling
b) EDF scheduling – Earliest Deadline First
c) HRRN scheduling – Highest Response Ratio Next
d) SRTN scheduling – Shortest Remaining Time Next
Answer: d
156. An SJF algorithm is simply a priority algorithm where the priority is ____________
a) the predicted next CPU burst
b) the inverse of the predicted next CPU burst
c) the current CPU burst
d) anything the user wants
Answer: a
Explanation: The larger the CPU burst, the lower the priority.
157. Choose one of the disadvantages of the priority scheduling algorithm?
a) it schedules in a very complex manner
b) its scheduling takes up a lot of time
c) it can lead to some low priority process waiting indefinitely for the CPU
d) none of the mentioned
Answer: c
158. What is ‘Aging’?
a) keeping track of cache contents
b) keeping track of what pages are currently residing in memory
c) keeping track of how many times a given page is referenced
d) increasing the priority of jobs to ensure termination in a finite time
Answer: d
159. A solution to the problem of indefinite blockage of low – priority processes is ____________
a) Starvation
b) Wait queue
c) Ready queue
d) Aging
Answer: d
160. Which of the following statements are true?
a) i only
b) i and iii only
c) ii and iii only
d) i, ii and iii
Answer: d
161. Which of the following scheduling algorithms gives minimum average waiting time?
a) FCFS
b) SJF
c) Round – robin
d) Priority
Answer: b
Answer: c
163. A situation where several processes access and manipulate the same data concurrently and the
outcome of the execution depends on the particular order in which access takes place is called
____________
a) data consistency
b) race condition
c) aging
d) starvation
Answer: b
164. he segment of code in which the process may change common variables, update tables, write into
files is known as ____________
a) program
b) critical section
c) non – critical section
d) synchronizing
Answer: b
165. Which of the following conditions must be satisfied to solve the critical section problem?
a) Mutual Exclusion
b) Progress
c) Bounded Waiting
d) All of the mentioned
Answer: d
Answer: a
167. Bounded waiting implies that there exists a bound on the number of times a process is allowed to
enter its critical section ____________
a) after a process has made a request to enter its critical section and before the request is granted
b) when another process is in its critical section
c) before a process has made a request to enter its critical section
d) none of the mentioned
Answer: a
168. A minimum of _____ variable(s) is/are required to be shared between processes to solve the
critical section problem.
a) one
b) two
c) three
d) four
Answer: b
169. In the bakery algorithm to solve the critical section problem ____________
a) each process is put into a queue and picked up in an ordered manner
b) each process receives a number (may or may not be unique) and the one with the lowest number is
served next
c) each process gets a unique number and the one with the highest number is served next
d) each process gets a unique number and the one with the lowest number is served next
Answer: b
170. An un-interruptible unit is known as ____________
a) single
b) atomic
c) static
d) none of the mentioned
Answer: b
Answer: c
Answer: c
Answer: a
Answer: d
Answer: b
176. The wait operation of the semaphore basically works on the basic _______ system call.
a) stop()
b) block()
c) hold()
d) wait()
Answer: b
177. The signal operation of the semaphore basically works on the basic _______ system call.
a) continue()
b) wakeup()
c) getup()
d) start()
Answer: b
Answer: a
179. The code that changes the value of the semaphore is ____________
a) remainder section code
b) non – critical section code
c) critical section code
d) none of the mentioned
Answer: c
180. The following program consists of 3 concurrent processes and 3 binary semaphores. The
semaphores are initialized as S0 = 1, S1 = 0, S2 = 0.
Process P0
while(true)
{
wait(S0);
print '0';
release(S1);
release(S2);
}
Process P1
wait(S1);
release(S0);
Process P2
wait(S2);
release(S0);
How many times will P0 print ‘0’?
a) At least twice
b) Exactly twice
c) Exactly thrice
d) Exactly once
Answer: a
repeat
P(mutex)
{Critical Section}
V(mutex)
forever
The code for P10 is identical except that it uses V(mutex) instead of P(mutex). What is the largest
number of processes that can be inside the critical section at any moment (the mutex being initialized
to 1)?
a) 1
b) 2
c) 3
d) None of the mentioned
Answer: c
Explanation: Any one of the 9 processes can get into critical section after executing P(mutex) which
decrements the mutex value to 0. At this time P10 can enter critical section by incrementing the value
to 1. Now any of the 9 processes can enter the critical section by again decrementing the mutex value
to 0. None of the remaining processes can get into their critical sections.
182. What will happen if a non-recursive mutex is locked more than once?
a) Starvation
b) Deadlock
c) Aging
d) Signaling
Answer: b
Explanation: If a thread which had already locked a mutex, tries to lock the mutex again, it will enter
into the waiting list of that mutex, which results in a deadlock. It is because no other thread can
unlock the mutex.