450 likes | 459 Views
This homework assignment discusses the different process scheduling algorithms and their impact on response time, wait time, and turnaround time in operating systems.
E N D
Homework 2 Sarah Diesburg Operating Systems COP 4610
Why does OS loader set kernel mode? • OS needs to run with full privileges • Sets more restrictive user mode bit for user programs • Protects OS from errant user programs
Time 700 800 0 100 200 300 400 500 600 Three Processes Process A Process B Process C
Time 700 800 0 100 200 300 400 500 600 First In, First Out Process A Process B Process C FIFO C A B
Time 700 800 0 100 200 300 400 500 600 First In, First Out Process A Process B Process C FIFO Average response time = [(300-50) + (500-150) + 0]/3 = 200 C A B
Time 700 800 0 100 200 300 400 500 600 First In, First Out Process A Process B Process C FIFO Average wait time = [(300-50) + (500-150) + 0]/3 = 200 C A B
Time 700 800 0 100 200 300 400 500 600 First In, First Out Process A Process B Process C FIFO Average turnaround time = [(500-50) + (900-150) + (300-0)]/3 = 500 C A A B B
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C B
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C B
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C B A
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C B A
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C B A C
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C B A C
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C B A C B
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR C A C B A C B
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR Average response time = [(100-50) + (300 – 150) + 0]/3 = 66.7 C A C B A C B
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR Average wait time = {[(100–50) + (400–200)] + [(300–150) + (600–400)] + [0 + (200–100) + (500–300)]}/3 = [250 + 350 + 300]/3 = 300 C A C B A C B
Time 700 800 0 100 200 300 400 500 600 Round Robin (Time slice = 100) Process A Process B Process C RR Average turnaround time = [(500 – 50) + (900 – 150) + (600 – 0)]/3 = 600 C A C B A C B
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN C
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN C
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN C A
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN C A
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN C A
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN C A B
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN C A B
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN Average response time = [(300-50) + (500-150) + 0]/3 = 200 C A B
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN Average wait time = [(300-50) + (500-150) + 0]/3 = 200 C A B
Time 700 800 0 100 200 300 400 500 600 Shortest Job Next Process A Process B Process C SJN Average turnaround time = [(500-50) + (900-150) + (300-0)]/3 = 500 C A B
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF C
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF C
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF C A
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF C A
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF C A C
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF C A C
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF C A C B
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF C A C B
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF Average response time = [0 + (500-150) + 0]/3 = 117 C A C B
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF Average wait time = [0 + (500 – 150) + (250 – 50)]/3 = 183 C A C B
Time 700 800 0 100 200 300 400 500 600 Shortest Remaining Time First Process A Process B Process C SRTF Average turnaround time = [(250 – 50) + (900 – 150) + (500 – 0)]/3 = 483 C A C B