Question
Process CPU Time Creation Time P1 20 0 P2 3 3 P3 2 5 Consider the set of processes in the table above. All times
Process | CPU Time | Creation Time |
---|---|---|
P1 | 20 | 0 |
P2 | 3 | 3 |
P3 | 2 | 5 |
Consider the set of processes in the table above.
All times are in milliseconds.
The CPU time is the total time required for the process (excluding any context switch time).
The creation time is the time when the process is created. So P1 is created when the problem begins and P3 is created 5 milliseconds later.
Assume each process performs no I/O, i.e., no process ever blocks.
QUESTION : When does each process finish if RR scheduling is used with q=1, if q=2, if q=3, if q=100?
First assume (unrealistically) that context switch time is zero.
Then assume it is 0.1.
If two processes have equal priority (in RR this means if they both enter the ready state at the same cycle), we give priority (in RR this means place first on the queue) to the process with the earliest creation time. If they also have the same creation time, then we give priority to the process with the lower number, i.e., P1 has priority over P2, which in turn has priority over P3. Since I use this rule for lab 2, I refer to it as the lab 2 tie-breaking rule.
1. Redo the previous homework for q=2 with the following changes. After process P1 runs for 3ms (milliseconds), it blocks for 2ms. P1 never blocks again. That is, P1 begins with a CPU burst of 3ms, then has an I/O burst of 2ms, and finally it has a CPU burst of 20-3 = 17ms. P2 never blocks. After P3 runs for 1 ms it blocks for 1ms. Assume the context switch time is zero. Remind me to answer this problem in class next lecture.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started