The Gateway to Computer Science Excellence
+3 votes

Here what are the number of context switches ? Is it 5 or 6? Do we consider context switch before P1 (i.e during the start) ?

in Operating System by Active (3.6k points) | 1.9k views
5 we dont count the starting one until it is mentioned in the question.

2 Answers

+3 votes
Here total 5 context switches ocur .

`p1 - p2

p2 - p3

p3- p4

p4 - p1

p1- p3


during start there is context switch but we don't consider that case.
by Veteran (74.8k points)

what about last context switch when P3 will terminate

i think 6 context switches should be there.

0 votes

context switch occurs when a computer’s CPU switches from one process or thread to a different process or thread.

It should be 5.

by Active (2.3k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,385 answers
105,368 users