Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider the following CPU processes with arr... Start Learning for Free
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:
Process    Arrival Time    Burst Time
P1                  0                  5
P2                  1                  1
P3                  3                  3
P4                  4                  x
If the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?
  • a)
    1
  • b)
    2
  • c)
    4
  • d)
    None of these
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
Consider the following CPU processes with arrival times (in millisecon...
If we take value of x is 2, then we have gantt chart as
So, completion time of P1, P2, P3, and P4 are 6, 2, 11, and 8 respectively. Turn around time of P1, P2, P3, and P4 are 6, 1, 8, and 4 respectively. Waiting time of P1, P2, P3, and P4 are 1, 0, 5, and 2 resectively. Therefore, average waiting time = (1+0+5+2) / 4 = 8/2 = 2 Option (B) is correct.
View all questions of this test
Most Upvoted Answer
Consider the following CPU processes with arrival times (in millisecon...
Given information:
- Arrival time and Burst time of processes P1, P2, P3 and P4 (except for the burst time of P4).
- Average waiting time across all processes is 2 milliseconds.
- Pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes.

Approach:
- As per the given scheduling algorithm, the process with the shortest remaining burst time is given the CPU first.
- Calculate the burst time of P4 using the given average waiting time and other process details.

Calculation:
- The waiting time for each process can be calculated as follows:
- Waiting time = (Completion time - Arrival time - Burst time)
- The completion time of each process can be calculated as follows:
- Completion time = (Arrival time + Burst time)
- The waiting time of each process is given as 2 milliseconds.
- Using the above equations, we can create the following table:

| Process | Arrival Time | Burst Time | Completion Time | Waiting Time |
|---------|--------------|------------|----------------|--------------|
| P1 | 0 | 5 | 5 | 0 |
| P2 | 1 | 1 | 2 | 1 |
| P3 | 3 | 3 | 6 | 3 |
| P4 | 4 | x | - | 2 |

- To calculate the burst time of P4, we can use the fact that the process with the shortest remaining burst time is given the CPU first.
- From the above table, we can see that P2 has the shortest remaining burst time of 1 millisecond.
- Hence, P2 will be given the CPU first and will complete at time 2 milliseconds.
- At this point, P4 will have arrived and its remaining burst time will be equal to the waiting time of P2, which is 1 millisecond.
- Therefore, the burst time of P4 is 1 millisecond.

Answer:
- The value of x is 1 millisecond.
- Hence, option (b) is the correct answer.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. Can you explain this answer?
Question Description
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. 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 the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. 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 the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. Can you explain this answer?.
Solutions for Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. 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 CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) except for process P4 as given below:Process Arrival Time Burst TimeP1 0 5P2 1 1P3 3 3P4 4 xIf the average waiting time across all processes is 2 milliseconds and pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then find the value of x ?a)1b)2c)4d)None of theseCorrect answer is option 'B'. 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