Process Concepts and Cpu Scheduling · Operating Systems · GATE CSE

Start Practice

Marks 1

1

Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running state (e.g., ready, blocked)?

GATE CSE 2024 Set 2
2

Which of the following process state transitions is/are NOT possible?

GATE CSE 2024 Set 1
3

Which one or more of the following need to be saved on a context switch from one thread (T1) of a process to another thread (T2) of the same process?

GATE CSE 2023
4

Which one or more of the following CPU scheduling algorithms can potentially cause starvation?

GATE CSE 2023
5
Which of the following statement(s) is/are correct in the context of CPU scheduling?
GATE CSE 2021 Set 2
6
Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux operating system?
GATE CSE 2021 Set 1
7
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 ready 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?
GATE CSE 2020
8
The following C program is executed on a Unix/Linux system:

         #include < unistd.h >
            int main ()
            {
                  int i ;
                  for (i=0; i<10; i++)
                         if (i%2 == 0) fork ( ) ;
                  return 0 ;
            }


The total number of child processes created is _____.
GATE CSE 2019
9
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?
GATE CSE 2016 Set 1
10
The maximum number of processes that can be in $$Ready$$ state for a computer system with $$n$$ $$CPUs$$ is
GATE CSE 2015 Set 3
11
Which one of the following is FALSE?
GATE CSE 2014 Set 1
12
A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler re-evaluates the process priorities every $$T$$ time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no $${\rm I}/O$$ operations and all arrive at time zero?
GATE CSE 2013
13
A process executes the code
fork $$\left( {\,\,\,} \right);$$
fork $$\left( {\,\,\,} \right);$$
fork $$\left( {\,\,\,} \right);$$
The total number of child processes created is
GATE CSE 2012
14
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 release)

$$ * \,\,\,$$ Interrupt from Hard Disk (raises interrupt when a disk read is completed)>/p>

Which one these will be handled at the HIGHEST priority?

GATE CSE 2011
15
Let the time taken to switch between user and kernel modes of execution be $${t_1}$$ while the time taken to switch between two processes be $${t_2}$$.

Which of the following is TRUE?

GATE CSE 2011
16
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?
GATE CSE 2011
17
Which of the following statements are true?
$${\rm I}.$$ Shortest remaining time first scheduling may cause starvation
$${\rm II}.$$ Preemptive scheduling may cause starvation
$${\rm III}.$$ Round robin is better than $$FCFS$$ in terms of response time
GATE CSE 2010
18
A CPU generally handles an interrupt by executing an interrupt service routine
GATE CSE 2009
19
Group-1 contains some $$CPU$$ scheduling algorithms and Group-2 contains some applications. Match entries in Group-1 to entries in Group-2.

Group-1
(P) Gang Scheduling
(Q) Rate Monotonic Scheduling
(R) Fair Share Scheduling

Group-2
(1) Guaranteed Scheduling
(2) Real-time Scheduling
(3) Thread Scheduling

GATE CSE 2007
20
Consider the following statements about user level threads and kernel level threads.

Which one of the following statements is FALSE?

GATE CSE 2007
21
Consider three $$CPU$$-intensive process, which require $$10,20$$ and $$30$$ time units and arrive at times $$0,2$$ and $$6$$ respectively. How many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.
GATE CSE 2006
22
Consider the following statements with respect to user-level threads and kernel-supported threads.
i) Context switch is faster with kernel- supported threads
ii) For user-level threads, a system call can block the entire process
iii) Kernel-supported threads can be scheduled independently
iv) Use-level threads are transparent to the kernel

Which of the above statements are true?

GATE CSE 2004
23
Which of the following scheduling algorithms is non-preemptive?
GATE CSE 2002
24
A processor needs software interrupt to
GATE CSE 2001
25
Consider a set of $$n$$ tasks with known runtimes $${r_1},{r_2},.....\,{r_n}\,\,$$ to be run on a uniprocessor machine. Which of the following processor scheduling algorithms will result in the maximum throughput?.
GATE CSE 2001
26
A CPU has two modes-privileged and non-privileged. In order to change the mode from privileged to non-privileged
GATE CSE 2001
27
System calls are usually invoked by using:
GATE CSE 1999
28
Which of the following is an example of spooled device?
GATE CSE 1998
29
Consider $$n$$ processes sharing the $$CPU$$ in a round-robin fashion. Assuming that each process switch takes $$s$$ seconds, what must be the quantum size $$q$$ such that the overhead resulting from process switching is minimized but, at the same time each process is guaranteed to get its turn at the $$CPU$$ at least every $$t$$ seconds?
GATE CSE 1998
30
The process state transition diagram in Figure is representative of GATE CSE 1996 Operating Systems - Process Concepts and Cpu Scheduling Question 65 English
GATE CSE 1996
31
Which of the following is an example of spooled device?
GATE CSE 1996
32
Which scheduling policy is most suitable for a time-shared operating systems?
GATE CSE 1995

Marks 2

1

Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU burst time.

A (0, 10), B (2, 6), C (4, 3), and D (6, 7).

Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?

GATE CSE 2024 Set 2
2

Consider four processes P, Q, R and S scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order P, Q, R, S, all at time t = 0. There is exactly one context switch from S to Q, exactly one context switch from R to Q, and exactly two context switches from Q to R. There is no context switch from S to P. Switching to a ready process after the termination of another process is also considered a context switch. Which one of the following is NOT possible as CPU burst time (in time units) of these processes?

GATE CSE 2022
3
Consider the following set of processes, assumed to have arrived at time 0. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order P1, P2, P3, P4. GATE CSE 2020 Operating Systems - Process Concepts and Cpu Scheduling Question 9 English
If the time quantum for RR is 4 ms, then the absolute value of the difference between the average turnaround times (in ms) of SJF and RR (round off to 2 decimal places) is _____.
GATE CSE 2020
4
Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below :
GATE CSE 2019 Operating Systems - Process Concepts and Cpu Scheduling Question 11 English
These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is 1 millisecond, then the value of Z is _____.
GATE CSE 2019
5
Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time first.

Process Arrival Time Burst Time
P1
P2
P3
P4
0
3
7
8
10
6
1
3

The average turn around time of these processes is milliseconds.

GATE CSE 2016 Set 2
6
Consider a uniprocessor system executing three tasks T1, T2 and T3, each of which is composed of an infinite sequence of jobs (or instances) which arrive periodically at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the inverse of its period, and the available tasks are scheduled in order of priority, with the highest priority task scheduled first. Each instance of T1, T2 and T3 requires an execution time of 1, 2 and 4 milliseconds, respectively. Given that all tasks initially arrive at the beginning of the 1st millisecond and task preemptions are allowed, the first instance of T3 completes its execution at the end of _____________ milliseconds.
GATE CSE 2015 Set 1
7
For the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time?

Process Arrival Time Processing Time
A 0 3
B 1 6
D 4 4
E 6 2

GATE CSE 2015 Set 3
8
An operating system uses $$shortest$$ $$remaining$$ $$time$$ $$first$$ scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times and $$CPU$$ burst times (in milliseconds):
Process Arrival Time Burst Time
P1 0 12
P2 2 4
P3 3 6
P4 8 5

The average waiting time (in milliseconds) of the processes is ________.

GATE CSE 2014 Set 3
9
Three processes $$A, B$$ and $$C$$ each execute a loop of $$100$$ iterations. In each iteration of the loop, a process performs a single computation that requires $${t_c}\,\,CPU$$ milliseconds and then initiates a single $${\rm I}/O$$ operation that lasts for $${t_{io}}$$ milliseconds. It is assumed that the computer where the processes execute has sufficient number of $${\rm I}/O$$ devices and the $$OS$$ of the computer assigns different $${\rm I}/O$$ devices to each process. Also, the scheduling overhead of the $$OS$$ is negligible. The processes have the following characteristics:
Process id tc tio
A 100 ms 500 ms
B 350 ms 500 ms
C 200 ms 500 ms

The processes $$A, B,$$ and $$C$$ are started at times $$0, 5$$ and $$10$$ milliseconds respectively, in a pure time sharing system (round robin scheduling) that uses a time slice of $$50$$ milliseconds. The time in milliseconds at which process $$C$$ would complete its first $${\rm I}/O$$ operation is __________.

GATE CSE 2014 Set 2
10
Consider the following set of processes that need to be scheduled on a single $$CPU.$$ All the times are given in milliseconds.
Process Name Arrival Time Execution Time
A 0 6
B 3 2
C 5 4
D 7 6
E 10 3

Using the $$shortest$$ $$remaining$$ $$time$$ $$first$$ scheduling algorithm, the average process turnaround time (in $$msec$$) is _______.

GATE CSE 2014 Set 1
11
Consider the $$3$$ processes, $$P1,$$ $$P2$$ and $$P3$$ shown in the table.
Process Arrival Time Time Units
Required
P1 0 5
P2 1 7
P3 3 4

The completion order of the $$3$$ processes under the policies $$FCFS$$ and $$RR2$$ (round robin scheduling with $$CPU$$ quantum of $$2$$ time units) are

GATE CSE 2012
12
Consider the following table of arrival time and burst time for three processes $$P0,P1$$ and $$P2$$.
Process Arrival Time Burst Time
P0 0 ms 9 ms
P1 1 ms 4 ms
P2 2 ms 9 ms

The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only a arrival or completion of processes. What is the average waiting time for the three processes?

GATE CSE 2011
13
In the following process state transition diagram for a uniprocessor system, assume that there are always some processes in the ready state: GATE CSE 2009 Operating Systems - Process Concepts and Cpu Scheduling Question 23 English

Now consider the following statements:
$$1.\,\,\,$$ If a process makes a transition $$D,$$ it would result in another process making transition $$A$$ immediately.
$$2.\,\,\,$$ $$A$$ process $${P_2}$$ in blocked state can make transition $$E$$ while another process $${P_1}$$ is in running state.
$$3.\,\,\,$$ The $$OS$$ uses preemptive scheduling.
$$4.\,\,\,$$ The $$OS$$ uses non-preemptive scheduling. Which of the above statements are TRUE?

GATE CSE 2009
14
A process executes the following code
for (i = 0; i < n; i + +) fork ( ); 
The total number of child processes created is
GATE CSE 2008
15
Which of the following is/are true of the auto-increment addressing mode?
$${\rm I}.\,\,\,$$ It is useful in creating self-relocating code
$${\rm II}.\,\,\,$$ If it is included in an Instruction Set Architecture, then an additional $$ALU$$ is required for effective address calculation.
$${\rm III}.\,\,\,$$ The amount of increment depends on the size of the data item accessed
GATE CSE 2008
16
An operating system uses Shortest Remaining Time first $$(SRT)$$ process scheduling algorithm. Consider the arrival times and execution times for the following processes: GATE CSE 2007 Operating Systems - Process Concepts and Cpu Scheduling Question 25 English

What is the total waiting time for process $$P2?$$

GATE CSE 2007
17
Consider three processes, all arriving at time zero, with total execution time of $$10,20,$$ and $$30$$ units, respectively. Each process spends the first $$20$$% of execution time doing $${\rm I}/O$$, the next $$70$$% of time doing computation, and the last $$10$$% of time doing $${\rm I}/O$$ again. The operating system uses a shortest remaining compute time first scheduling algorithm and scheduling a new process either when the running processes gets blocked on $${\rm I}/O$$ or when the running process finishes its compute burst. Assume that all $${\rm I}/O$$ operations can be overlapped as much as possible. For what percentage of time does the $$CPU$$ remain idle?
GATE CSE 2006
18
Consider three processes (process id $$0,1,2,$$ respectively) with compute time bursts $$2, 4,$$ and $$8$$ time units. All processes arrive at time zero. Consider the longest remaining time first $$(LRTF)$$ scheduling algorithm. In $$LRTF$$ ties are broken by giving priority to the process with the lowest process id. The average turn around time is
GATE CSE 2006
19
Consider the following code fragment:
if (fork() == 0)
{
   a = a + 5;
   printf("%d, %d \n", a, &a);
}
else
{
   a = a - 5;
   printf ("%d, %d \n", a, &a);
}

Let $$u,v$$ be the values printed by the parent process, and $$x,y$$ be the values printed by the child process. Which one of the following is TRUE?
GATE CSE 2005
20
Consider the following set of processes, with the arrival times and the $$CPU$$-burst times given in milliseconds. GATE CSE 2004 Operating Systems - Process Concepts and Cpu Scheduling Question 31 English

What is the average turnaround time for these processes with the preemptive shortest remaining processing time first $$(SRTF)$$ algorithm?

GATE CSE 2004
21
A uni-processor computer system only has two processes, both of which alternate $$10$$ $$ms$$ $$CPU$$ bursts with $$90$$ $$ms$$ $${\rm I}/O$$ bursts. Both the processes were created at nearly the same time. The $${\rm I}/O$$ of both processes can proceed in parallel. Which of the following scheduling strategies will result in the least $$CPU$$ utilization (over a long period of time) for this system?
GATE CSE 2003
22
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 a program terminates, another program is immediately scheduled for execution.
GATE CSE 2002
23
Draw the process state transition diagram of an $$OS$$ in which
(i) each process is in one of the five states: created, ready, running, blocked (i.e. sleep or wait), or terminated, and
(ii) only non-preemptive scheduling is used by the $$OS.$$ Label the transitions appropriately.
GATE CSE 2002
24
Which of the following does not interrupt a running process?
GATE CSE 2001
25
Which of the following actions is/are typically not performed by the operating system when switching context from process $$A$$ to process $$B$$ ?
GATE CSE 1999
26
A multi-user, multi-processing operating system cannot be implemented on hardware that does not support:
GATE CSE 1999
27
Four jobs are waiting to be run. Their expected run times are $$6, 3, 5$$ and $$x$$. $${\rm I}$$n what order should they be run to minimize the average response time?
GATE CSE 1998
28
Four jobs to be executed on a single processor system arrive at time $${0^ + }$$ in the order $$A, B, C, D.$$ their burst $$CPU$$ time requirements are $$4, 1, 8, 1$$ time units respectively. The completion time of A under round robin scheduling with time slice of one time units.
GATE CSE 1996
29
The sequence $$.........$$ is an optimal non-preemptive scheduling sequence for the following jobs which leaves the $$CPU$$ idle for $$..........$$ Unit (s) of time GATE CSE 1995 Operating Systems - Process Concepts and Cpu Scheduling Question 27 English
GATE CSE 1995
30
Assume that the following jobs are to be executed on a single processor system.
Job Id CPU Burst Time
p 4
q 1
r 8
s 1
t 2

The jobs are assumed to have arrived at time $${0^ + }$$ and in the order $$p,q,r,s,t.$$ Calculate the departure time (completion time) for job $$p$$ if scheduling is round robin with time slice$$1.$$

GATE CSE 1993
31
The details of an interrupt cycle are shown in Figure GATE CSE 1993 Operating Systems - Process Concepts and Cpu Scheduling Question 41 English
Given that an interrupt input arrives every $$1$$ $$msec,$$ what is the percentage of the total time that the $$CPU$$ devotes for the main program execution.
GATE CSE 1993
32
Which of the following is an example of a spooled device?
GATE CSE 1992
33
The highest-response ratio next scheduling policy favours $$.......$$ jobs, but it also limits the waiting time of $$ .....$$ jobs.
GATE CSE 1990
34
State an undesirable characteristic of each of the following criteria for measuring performance of an operating system:
(a) Turn around time. (b) Waiting time.
GATE CSE 1988
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12