Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider three CPU intensive processes P1, P2... Start Learning for Free
Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).
  • a)
    3
  • b)
    2
  • c)
    4
  • d)
    5
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Consider three CPU intensive processes P1, P2, P3 which require 20, 10...
There are 3 context switch. So. option (A) is correct.
View all questions of this test
Most Upvoted Answer
Consider three CPU intensive processes P1, P2, P3 which require 20, 10...
Explanation:

To determine the number of context switches required, let's analyze the execution of the three CPU intensive processes P1, P2, and P3.

- P1 arrives at time 1 and requires 20 units of time.
- P2 arrives at time 3 and requires 10 units of time.
- P3 arrives at time 7 and requires 30 units of time.

The scheduling algorithm being used is Shortest Remaining Time first (preemptive scheduling). This means that the process with the shortest remaining time is given priority to execute.

Step 1: P1 starts execution at time 1 and runs for 1 unit of time.
- Remaining time for P1: 19
- At this point, a context switch occurs.

Step 2: P2 starts execution at time 2 and runs for 1 unit of time.
- Remaining time for P2: 9
- At this point, a context switch occurs.

Step 3: P1 resumes execution at time 3 and runs for 9 units of time.
- Remaining time for P1: 10
- At this point, a context switch occurs.

Step 4: P2 resumes execution at time 4 and runs for 6 units of time.
- Remaining time for P2: 3
- At this point, a context switch occurs.

Step 5: P3 starts execution at time 7 and runs for 1 unit of time.
- Remaining time for P3: 29
- At this point, a context switch occurs.

Step 6: P2 resumes execution at time 8 and runs for 2 units of time.
- Remaining time for P2: 1
- At this point, a context switch occurs.

Step 7: P2 resumes execution at time 10 and runs for 1 unit of time.
- Remaining time for P2: 0
- At this point, P2 completes execution.

Step 8: P1 resumes execution at time 12 and runs for 10 units of time.
- Remaining time for P1: 0
- At this point, P1 completes execution.

Step 9: P3 resumes execution at time 14 and runs for 28 units of time.
- Remaining time for P3: 1
- At this point, a context switch occurs.

Step 10: P3 resumes execution at time 42 and runs for 1 unit of time.
- Remaining time for P3: 0
- At this point, P3 completes execution.

Therefore, a total of 3 context switches are required.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer?
Question Description
Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer?.
Solutions for Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer?, a detailed solution for Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and 30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system is implementing Shortest Remaining Time first (preemptive scheduling) algorithm, then _____ context switches are required (suppose context switch at the beginning of Ready queue and at the end of Ready queue are not counted).a)3b)2c)4d)5Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev