GATE Questions & Answers of Processes, Threads

What is the Weightage of Processes, Threads in GATE Exam?

Total 16 Questions have been asked from Processes, Threads topic of Operating System subject in previous GATE papers. Average marks 1.31.

Threads of a process share 

A multithreaded program P executes with x number of threads and uses y number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock l, then it cannot re-acquire lock l without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes avilable. The minimum value of x and the minimum value of y together for which execution of P can result in a deadlock are:

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

I. Program counter

II. Stack

III. Address space

IV. Registers

Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready queue?

The maximum number of processes that can be in Ready state for a computer system with n CPUs is

Which one of the following is FALSE?

A process executes the code

     fork();
     fork();
     fork();

The total number of child processes created is

Let the time taken to switch between user and kernel modes of execution be t1 while the time taken to switch between two processes be t2. Which of the following is TRUE?

A computer handles several interrupt sources of which the following are relevant for this question.

• Interrupt from CPU temperature sensor (raises interrupt if CPU temperature is too high)

• Interrupt from Mouse (raises interrupt if the mouse is moved or a button is pressed)

• Interrupt from Keyboard (raises interrupt when a key is pressed or released)

• Interrupt from Hard Disk (raises interrupt when a disk read is completed)

Which one of these will be handled at the HIGHEST priority?

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?

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?

Which of the following system calls results in the sending of SYN packets?

Which of the following statements about synchronous and asynchronous I/O is NOT true?

A process executes the following code

for (i = 0; i < n; i + +)   fork ( );

The total number of child processes created is

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

An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:

Process Execution
time
Arrival
time
P1 20 0
P2 25 15
P3 10 30
P4 15 45

What is the total waiting time for process P2?