Process & Threads GATE CS PYQ Quiz

Last Updated :
Discuss
Comments

Question 1

Which one of the following is FALSE?

  • User level threads are not scheduled by the kernel.

  • When a user level thread is blocked, all other threads of its process are blocked.

  • Context switching between user level threads is faster than context switching between kernel level threads.

  • Kernel level threads cannot share the code segment

Question 2

A thread is usually defined as a "light weight process" because an operating system (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the following is TRUE?

  • On per-thread basis, the OS maintains only CPU register state

  • The OS does not maintain a separate stack for each thread

  • On per-thread basis, the OS does not maintain virtual memory state

  • On per-thread basis, the OS maintains only scheduling and accounting information

Question 3

Consider the following statements about user level threads and kernel level threads. Which one of the following statement is FALSE?

  • Context switch time is longer for kernel level threads than for user level threads.

  • User level threads do not need any hardware support.

  • Related kernel level threads can be scheduled on different processors in a multi-processor system.

  • Blocking one kernel level thread blocks all related threads.

Question 4

Which of the following need not necessarily be saved on a context switch between processes?

  • General purpose registers

  • Translation look aside buffer

  • Program counter

  • All of the above

Question 5

The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.

P1() 
{
C = B – 1;
B = 2*C;
}

P2()
{
D = 2 * B;
B = D - 1;
}

The number of distinct values that B can possibly take after the execution is

  • 3

  • 2

  • 5

  • 4

Question 6

Consider the following statements about process state transitions for a system using preemptive scheduling.

  • I. A running process can move to ready state.
  • II. A ready process can move to running state.
  • III. A blocked process can move to running state.
  • IV. A blocked process can move to ready state.

Which of the above statements are TRUE ?

  • I, II, and III only

  • II and III only

  • I, II, and IV only

  • I, II, III and IV only

Question 7

In the following process state transition diagram for a uniprocessor system, assume that there are always some processes in the ready state: Now consider the following statements:

I. If a process makes a transition D, it would result in 
another process making transition A immediately.
II. A process P2 in blocked state can make transition E
while another process P1 is in running state.
III. The OS uses preemptive scheduling.
IV. The OS uses non-preemptive scheduling.

Which of the above statements are TRUE?

  • I and II

  • I and III

  • II and III

  • II and IV

Question 8

Which combination of the following features will suffice to characterize an OS as a multi-programmed OS?

(a) More than one program may be loaded into main memory 
at the same time for execution.
(b) If a program waits for certain events such as I/O,
another program is immediately scheduled for execution.
(c) If the execution of program terminates, another program
is immediately scheduled for execution.
  • a

  • a and b

  • a and c

  • a, b and c

Question 9

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

Question 10

Which of the following is/are shared by all the threads in a process?

I. Program Counter

II. Stack

III. Address space

IV. Registers
  • I and II only

  • III only

  • IV only

  • III and IV only

There are 19 questions to complete.

Take a part in the ongoing discussion