GATE CSE Operating Systems — practice questions
40 free MCQs with worked solutions. Tap any question for the answer + explanation, or practice them all in the app.
Practice GATE CSE Operating Systems in the app →The Process Control Block (PCB) storesLaunching Chrome twice on the same machine createsA running process that issues a blocking disk read transitions to which state?Two threads inside the same process shareIn the many-to-one user-to-kernel thread mapping, a single blocking I/O callThread context switches are cheaper than process context switches becauseAmong non-preemptive CPU scheduling algorithms, which is provably optimal for average waiting time?What happens to Round Robin scheduling when the time quantum becomes very small (close to zero)?Starvation in SJF (a long job never running) is typically cured byIn a multilevel feedback queue, a process that consistently exhausts its full time quantumThree processes arrive at t=0 with bursts 24, 3, 3. The average waiting time under SJF isResponse time, the metric MLFQ optimises most for interactive workloads, isUnder the FIRST-IN, FIRST-OUT (FIFO) scheduling policy (also called FCFS), three jobs A, B, C arrive at $t=0$ The SHORTEST JOB FIRST (SJF) scheduler addresses the convoy effect byWhen jobs arrive at DIFFERENT times, non-preemptive SJF can still suffer from a long job running before a shorROUND-ROBIN (RR) scheduling improves response time byThree jobs A (10s), B (5s), C (5s) all arrive at $t=0$. Compare the AVERAGE RESPONSE TIME under FIFO vs Round-The TURNAROUND TIME of a job is defined asIncreasing the RR time slice from 1 ms to 100 ms generally has what effect on the system?For workloads consisting MOSTLY of I/O-bound jobs (jobs that do short CPU bursts then wait for I/O), the IDEALA scheduling DISCIPLINE (or policy) is BLIND if itJobs A (run time 100, arrival 0), B (run time 10, arrival 0), C (run time 10, arrival 0) under SJF give what aSTCF runs job A (100) at t=0, but at t=10 jobs B (10) and C (10) arrive. What does STCF do?The PRIMARY DISADVANTAGE of FIFO scheduling isWhich of the following is NOT typically minimised by a CPU scheduler?For a fully PREEMPTIVE scheduler to function correctly, the OS must supportA LOCK (mutex) is used by concurrent threads toA SPIN LOCK (or busy-waiting lock) is one in which a thread that finds the lock heldThe TEST-AND-SET ($TAS$) hardware instruction has the property that itThe COMPARE-AND-SWAP (CAS) instruction is more powerful than $TAS$ because itTwo threads running the unsynchronised counter increment `c++` on a shared variable can produce an incorrect fA LOCK is considered FAIR ifWhat is the PRIMARY problem with using a SPIN LOCK on a SINGLE-CPU uniprocessor system (with preemptive scheduLinux's `pthread_mutex_lock()` is typically implemented as a HYBRID:A CRITICAL SECTION isWithout atomic hardware support, building a correct mutual-exclusion lock for $N \geq 2$ threads isSuppose thread A acquires lock L1, then thread B acquires lock L2. Now A tries to acquire L2 while B tries to A LIVELOCK differs from a DEADLOCK in thatDisabling INTERRUPTS as a way to implement mutual exclusion on a single-CPU system isOn a MULTI-CORE system, a SPIN LOCK is generally