View Single Post
Old 09-30-2004, 01:52 PM   #1 (permalink)
feelgood
Free Mars!
 
feelgood's Avatar
 
Location: I dunno, there's white people around me saying "eh" all the time
Operating System Scheduling

Hey Guys,

I'm working on figuring out process waiting time for 4 different operating system scheduling time.

The 4 different types are First Come, First Served, Shortest Job First, Non-preemptive and Round Robin.

I have 5 different Process

P1 takes 10 brust and are priority 3
P2 takes 1 burst and are priority 1
P3 takes 2 burst and are priority 3
P4 takes 1 burst and are priority 4
P5 takes 5 burst and are priority 2

FCFS
----------10-11--13-14-----19

Average wait time = (10+11+13+14)/5 = 9.6 millisecond

SJF
-1-2--4-----9----------19

Average wait time = (1+2+4+9)/5 = 3.2 millisecond

Nonpreemptive
-1-----6--8----------18-19

Average wait time = (1+6+8+18)/5 = 6.8 millisecond

RoundRobin Quantum = 1
-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19

I believe I've got the first 3 right. But Round Robin is somewhat more difficult to understand. I understand that each process are allocated to 1 time quantum of CPU. But what I can't understand is how to calculate the average waiting time. It's not the same as calculating the average wait time as the other 3 since once process #2 and 4 are completed, they're not part of the average waiting time formula anymore.
__________________
Looking out the window, that's an act of war. Staring at my shoes, that's an act of war. Committing an act of war? Oh you better believe that's an act of war
feelgood is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52