Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider the following set of processes, with... Start Learning for Free
Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds
  Process   Arrival Time    Burst Time
    P1          0                     5
    P2          1                     3
    P3          2                     3
    P4          4                     1
What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?
  • a)
    5.50
  • b)
    5.75
  • c)
    6.00
  • d)
    6.25
Correct answer is option 'A'. Can you explain this answer?
Most Upvoted Answer
Consider the following set of processes, with the arrival times and th...
The following is Gantt Chart of execution
P1    P2    P4    P3    P1
1       4       5       8    12  
Turn Around Time = Completion Time - Arrival Time   Avg Turn Around Time  =  (12 + 3 + 6+  1)/4 = 5.50
Free Test
Community Answer
Consider the following set of processes, with the arrival times and th...
Solution:

Preemptive SRPT Algorithm

In the preemptive SRPT algorithm, the process with the shortest remaining time is given priority to execute. If a new process arrives with a shorter burst time than the currently executing process, the CPU is preempted and the new process is scheduled.

Calculation of Turnaround Time

Turnaround time is the total time taken by a process from arrival to completion, including both CPU and waiting time.

Turnaround time = Completion time - Arrival time

Calculation of Completion Time

Completion time is the time at which a process completes its execution.

Completion time = Arrival time + Burst time

Calculation of Waiting Time

Waiting time is the time a process spends waiting in the ready queue before it gets the CPU.

Waiting time = Turnaround time - Burst time

Given Process Details

Process Arrival Time Burst Time
P1 0 5
P2 1 3
P3 2 3
P4 4 1

Step-by-Step Calculation

- At time 0, process P1 arrives and executes. Remaining burst time of P1 is 5.
- At time 1, process P2 arrives with a burst time of 3. P2 is shorter than P1, so P1 is preempted and P2 executes. Remaining burst time of P2 is 2.
- At time 2, process P3 arrives with a burst time of 3. P2 is shorter than P3, so P2 continues to execute. Remaining burst time of P2 is 1.
- At time 3, P2 completes its execution. Completion time of P2 is 3. Turnaround time of P2 is 3 - 1 = 2. Waiting time of P2 is 2.
- At time 4, process P4 arrives with a burst time of 1. P4 is shorter than P3, so P3 is preempted and P4 executes. Remaining burst time of P4 is 0.
- At time 5, P1 resumes execution. Remaining burst time of P1 is 4.
- At time 6, P3 resumes execution. Remaining burst time of P3 is 2.
- At time 7, P3 completes its execution. Completion time of P3 is 7. Turnaround time of P3 is 7 - 2 = 5. Waiting time of P3 is 2.
- At time 8, P1 is preempted by P4. Remaining burst time of P4 is 0.
- At time 9, P1 completes its execution. Completion time of P1 is 9. Turnaround time of P1 is 9 - 0 = 9. Waiting time of P1 is 4.
- At time 10, P4 completes its execution. Completion time of P4 is 10. Turnaround time of P4 is 10 - 4 = 6. Waiting time of P4 is 3.

Calculation of Average Turnaround Time

Average turnaround time is the sum of the turnaround times of all the processes divided by the number of processes.

Average turnaround time = (2 + 5 + 9 + 6) / 4 = 5.5

Therefore, the average turnaround time for these processes with the preemptive SRPT algorithm is 5.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer?
Question Description
Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 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 the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer?.
Solutions for Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct 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 the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer?, a detailed solution for Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct 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