Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

35
Review Questions Review Questions on on Chapter III— Chapter III— Scheduling Scheduling COSC 4330/6310 COSC 4330/6310 Summer 2013 Summer 2013

Transcript of Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Page 1: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Review Questions onReview Questions onChapter III—Scheduling Chapter III—Scheduling

COSC 4330/6310COSC 4330/6310

Summer 2013Summer 2013

Page 2: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

First QuestionFirst Question

In the Round Robin policy, what the In the Round Robin policy, what the advantages and disadvantages of advantages and disadvantages of selecting a small time quantum? selecting a small time quantum? (2×5 points)(2×5 points)

Page 3: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

First QuestionFirst Question

In the Round Robin policy, what the In the Round Robin policy, what the advantages and disadvantages of advantages and disadvantages of selecting a small time quantum? selecting a small time quantum? (2×5 points)(2×5 points)

The main advantage of small time The main advantage of small time slices is a faster response time for slices is a faster response time for interactive requestsinteractive requests

Page 4: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

First QuestionFirst Question

In the Round Robin policy, what the In the Round Robin policy, what the advantages and disadvantages of advantages and disadvantages of selecting a small time quantum? selecting a small time quantum? (2×5 points)(2×5 points)

The main advantage of small time The main advantage of small time slices is a faster response time for slices is a faster response time for interactive requestsinteractive requests

Their main disadvantage is too much Their main disadvantage is too much CPU time taken by context switchesCPU time taken by context switches

Page 5: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Second QuestionSecond Question

Consider the following set of parameters for Consider the following set of parameters for a System V Release 4 scheduler with four a System V Release 4 scheduler with four priority levels:priority levels:

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

800 X 1 1000 1 # 0800 X 1 1000 1 # 0

400 0 2 1000 2 # 1400 0 2 1000 2 # 1

200 1 3 200 3 # 2200 1 3 200 3 # 2

100 2 Y 200 3 # 3100 2 Y 200 3 # 3

Which are the sole reasonable values for X Which are the sole reasonable values for X and Y? and Y?

• X=__ and Y= __X=__ and Y= __

Page 6: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Second QuestionSecond Question

Consider the following set of parameters for Consider the following set of parameters for a System V Release 4 scheduler with four a System V Release 4 scheduler with four priority levels:priority levels:

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

800 X 1 1000 1 # 0800 X 1 1000 1 # 0

400 0 2 1000 2 # 1400 0 2 1000 2 # 1

200 1 3 200 3 # 2200 1 3 200 3 # 2

100 2 Y 200 3 # 3100 2 Y 200 3 # 3

Which are the sole reasonable values for X Which are the sole reasonable values for X and Y? and Y?

• X=_X=_00_ and Y= ___ and Y= __

Page 7: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Second QuestionSecond Question

Consider the following set of parameters for Consider the following set of parameters for a System V Release 4 scheduler with four a System V Release 4 scheduler with four priority levels:priority levels:

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

800 X 1 1000 1 # 0800 X 1 1000 1 # 0

400 0 2 1000 2 # 1400 0 2 1000 2 # 1

200 1 3 200 3 # 2200 1 3 200 3 # 2

100 2 Y 200 3 # 3100 2 Y 200 3 # 3

Which are the sole reasonable values for X Which are the sole reasonable values for X and Y? and Y?

• X=_X=_00_ and Y= __ and Y= _33__

Page 8: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Third QuestionThird Question

Consider the following System V Release Consider the following System V Release 4 scheduler:4 scheduler:

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

800 0 1 16000 0 # 0800 0 1 16000 0 # 0

400 0 2 8000 2 # 1400 0 2 8000 2 # 1

200 2 3 4000 3 # 2200 2 3 4000 3 # 2

100 2 4 2000 4 # 3100 2 4 2000 4 # 3

and identify the four incorrect parameters: and identify the four incorrect parameters: (4×5 points)(4×5 points)

Page 9: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Third QuestionThird Question

Consider the following System V Release Consider the following System V Release 4 scheduler:4 scheduler:

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

800 0 1 16000 0 # 0800 0 1 16000 0 # 0

400 0 2 8000 2 # 1400 0 2 8000 2 # 1

200 200 2 2 3 4000 3 # 2 3 4000 3 # 2

100 2 4 2000 4 # 3100 2 4 2000 4 # 3

and identify the four incorrect parameters: and identify the four incorrect parameters: (4×5 points)(4×5 points)

Page 10: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Third QuestionThird Question

Consider the following System V Release Consider the following System V Release 4 scheduler:4 scheduler:

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

800 0 1 16000 0 # 0800 0 1 16000 0 # 0

400 0 2 8000 2 # 1400 0 2 8000 2 # 1

200 200 2 2 3 4000 3 # 2 3 4000 3 # 2

100 2 4 2000 4 # 3100 2 4 2000 4 # 3

and identify the four incorrect parameters: and identify the four incorrect parameters: (4×5 points)(4×5 points)

Page 11: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Third QuestionThird Question

Consider the following System V Release Consider the following System V Release 4 scheduler:4 scheduler:

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

800 0 1 16000 0 # 0800 0 1 16000 0 # 0

400 0 2 8000 2 # 1400 0 2 8000 2 # 1

200 200 2 2 3 4000 3 # 2 3 4000 3 # 2

100 2 4 2000 4 # 3100 2 4 2000 4 # 3

and identify the four incorrect parameters: and identify the four incorrect parameters: (4×5 points)(4×5 points)

Page 12: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Third QuestionThird Question

Consider the following System V Release Consider the following System V Release 4 scheduler:4 scheduler:

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

800 0 1 16000 0 # 0800 0 1 16000 0 # 0

400 0 2 8000 2 # 1400 0 2 8000 2 # 1

200 200 2 2 3 4000 3 # 2 3 4000 3 # 2

100 2 4 2000 4 # 3100 2 4 2000 4 # 3

and identify the four incorrect parameters: and identify the four incorrect parameters: (4×5 points)(4×5 points)

Page 13: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Fourth QuestionFourth Question

Consider the following System V Release Consider the following System V Release 4 scheduler: (3×5 points)4 scheduler: (3×5 points)

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL #ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

1000 0 1 16000 1 # 01000 0 1 16000 1 # 0

500 1 2 8000 2 # 1500 1 2 8000 2 # 1

200 1 3 4000 3 # 2200 1 3 4000 3 # 2

100 2 3 2000 3 # 3100 2 3 2000 3 # 3

Which events can Which events can increaincreasese the priority the priority of a process at level 2? of a process at level 2?

Which events can Which events can lowerlower it? it?

Page 14: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Fourth QuestionFourth Question

Consider the following System V Consider the following System V Release 4 scheduler: (3×5 points)Release 4 scheduler: (3×5 points)

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL #ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

1000 0 1 16000 1 # 01000 0 1 16000 1 # 0

500 1 2 8000 2 # 1500 1 2 8000 2 # 1

200 1 3 4000 3 # 2200 1 3 4000 3 # 2

100 2 3 2000 3 # 3100 2 3 2000 3 # 3

A return from the wait state or a long A return from the wait state or a long wait in the ready queue will increase wait in the ready queue will increase the priority of a processthe priority of a process

Page 15: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Fourth QuestionFourth Question

Consider the following System V Release 4 Consider the following System V Release 4 scheduler: (3×5 points)scheduler: (3×5 points)

#ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL #ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait LVL

1000 0 1 16000 1 # 01000 0 1 16000 1 # 0

500 1 2 8000 2 # 1500 1 2 8000 2 # 1

200 1 3 4000 3 # 2200 1 3 4000 3 # 2

100 2 3 2000 3 # 3100 2 3 2000 3 # 3

A return from the wait state or a long wait in A return from the wait state or a long wait in the ready queue will increase the priority of the ready queue will increase the priority of a processa process

A CPU timer interrupt will decrease itA CPU timer interrupt will decrease it

Page 16: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Short QuestionsShort Questions

What is the major limitation of theWhat is the major limitation of the round-round-robinrobin scheduling policy? scheduling policy?

Page 17: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Short QuestionsShort Questions

What is the major limitation of theWhat is the major limitation of the round-round-robinrobin scheduling policy? scheduling policy?

RR cannot provide at the same time a RR cannot provide at the same time a good interactive response time and a good interactive response time and a good throughput at medium to heavy good throughput at medium to heavy loadload

Page 18: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Short QuestionsShort Questions

What is the main advantage of What is the main advantage of preemptive schedulerspreemptive schedulers over non-over non-preemptive ones? preemptive ones?

Page 19: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Short QuestionsShort Questions

What is the main advantage of What is the main advantage of preemptive schedulerspreemptive schedulers over non-over non-preemptive ones?preemptive ones?

Scheduler can take CPU way from Scheduler can take CPU way from processes "monopolizing" the CPUprocesses "monopolizing" the CPU

• Other processes do not have to wait Other processes do not have to wait as longas long

Page 20: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Short QuestionsShort Questions

What do schedulers typically do to What do schedulers typically do to increase the priorities of I/O-bound increase the priorities of I/O-bound processes? processes?

Page 21: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Short QuestionsShort Questions

What do schedulers typically do to What do schedulers typically do to increase the priorities of I/O-bound increase the priorities of I/O-bound processes?processes?

They increase the priorities of They increase the priorities of processes returning to the ready queue processes returning to the ready queue from the wait statefrom the wait state

• Very likely to have performed an I/O Very likely to have performed an I/O

Page 22: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Short QuestionsShort Questions

What do schedulers typically do to lower What do schedulers typically do to lower the priorities of CPU-bound processes? the priorities of CPU-bound processes?

Page 23: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

Short QuestionsShort Questions

What do schedulers typically do to lower What do schedulers typically do to lower the priorities of CPU-bound processes?the priorities of CPU-bound processes?

They decrease the priority of They decrease the priority of processes who have been preempted processes who have been preempted because they have exhausted their because they have exhausted their CPU time sliceCPU time slice

Page 24: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

The Round-Robin scheduling algorithm The Round-Robin scheduling algorithm does not differentiate between CPU-does not differentiate between CPU-bound and I/O-bound processes. bound and I/O-bound processes.

Page 25: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

The Round-Robin scheduling algorithm The Round-Robin scheduling algorithm does not differentiate between CPU-does not differentiate between CPU-bound and I/O-bound processes. bound and I/O-bound processes.

TRUE because all processes have the TRUE because all processes have the same priority same priority

Page 26: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

The Round-Robin scheduling algorithm The Round-Robin scheduling algorithm is is starvation-freestarvation-free. .

Page 27: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

The Round-Robin scheduling algorithm The Round-Robin scheduling algorithm is is starvation-freestarvation-free..

TRUE because all processes have the TRUE because all processes have the same priority same priority

Page 28: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

Most schedulers adjust the priorities of Most schedulers adjust the priorities of real-time processesreal-time processes in order to give in order to give each process its each process its fair sharefair share of the CPU. of the CPU.

Page 29: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

Most schedulers adjust the priorities of Most schedulers adjust the priorities of real-time processesreal-time processes in order to give in order to give each process its each process its fair sharefair share of the CPU. of the CPU.

FALSE, the schedulers we have FALSE, the schedulers we have discussed assign fixed priorities to discussed assign fixed priorities to real-time processes real-time processes

Page 30: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

Steps taken to decrease the Steps taken to decrease the response response timetime of a system can sometimes of a system can sometimes decrease its decrease its throughput.throughput.

Page 31: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

Steps taken to decrease the Steps taken to decrease the response response timetime of a system can sometimes of a system can sometimes decrease its decrease its throughput.throughput.

TRUE, think of the round-robin policyTRUE, think of the round-robin policy

Page 32: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

All preemptive policies have multiple All preemptive policies have multiple priority levels. priority levels.

Page 33: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

All preemptive policies have multiple All preemptive policies have multiple priority levels. priority levels.

TRUE, think of the round-robin policyTRUE, think of the round-robin policy

Page 34: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

The throughput of a computer using a The throughput of a computer using a round-robin scheduling policy often goes round-robin scheduling policy often goes down when the number of users goes down when the number of users goes up. up.

Page 35: Review Questions on Chapter III—Scheduling COSC 4330/6310 Summer 2013.

True or FalseTrue or False

The throughput of a computer using a The throughput of a computer using a round-robin scheduling policy often goes round-robin scheduling policy often goes down when the number of users goes down when the number of users goes up. . up. .

TRUE because the context switch TRUE because the context switch overhead is likely to increaseoverhead is likely to increase