제 4 장 process scheduling

Click here to load reader

Upload: bayle

Post on 01-Feb-2016

60 views

Category:

Documents


0 download

DESCRIPTION

제 4 장 Process Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithm Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation. Basic Concepts. CPU-I/O Burst Cycle CPU Scheduler Preemptive Scheduling Dispatcher. 다중프로그래밍 (multiprogramming) - PowerPoint PPT Presentation

TRANSCRIPT

  • 4 Process Scheduling

  • Basic ConceptsScheduling CriteriaScheduling AlgorithmMultiple-Processor SchedulingReal-Time SchedulingAlgorithm Evaluation

  • Basic ConceptsCPU-I/O Burst CycleCPU SchedulerPreemptive SchedulingDispatcher

  • (multiprogramming) (time sharing) : (process scheduling) ( ) (space sharing) :

  • CPU-I/O Burst Cycle CPU : CPU

    CPU (hyper-exponential) CPU CPU CPU CPU

  • CPU Scheduler (short-term scheduling) CPU Firest-In Firtst-Out CPU

  • / (nonpreemptive scheduling) no preemption( )( )( ) (preemptive scheduling) ,

  • Dispatcher

    CPU switching (time slice, time quantum) (interrupt) CPU (interrupt handler) * dispatcher (preemption) CPU

  • Scheduling CriteriaCPU CPU

  • (performance index) (response time) (throughput) (utilization) OS

  • OS (fairness) (throughput) (mean response time) (predictability) (resource utilization) (no indefinite postponement) (aging)

  • runningreadyasleepsuspended readysuspended blockedcreatedterminateddispatch(schedule)timerrunout(preemption)exitsleep(block)wakeupwakeupswap-out(suspend)swap-out(suspend)swap-in(resume)swap-in(resume)Medium-termschedulingLong-termschedulingShort-termscheduling

  • Scheduling AlgorithmsFirst-Come First-served SchedulingShortest-Job-First SchedulingPriority SchedulingRound-Robin SchedulingMultilevel Queue SchedulingMultilevel Feedback queue SchedulingHRN SchedulingMulti processor Scheduling

  • FIFO(First-In-First-Out) nonpreemptive scheduling .Convoy effect

  • ProcessorP1P2P3P4completionFIFO

  • P1P2P3P4P50123456789 1011121314151617181920P1P2P3P4P5P1P2P3P4P5FIFO Process IDArrival timeService time(Processing time)P1P2P3P4P50135637253

  • RR (Round-Robin) preemptive scheduling (time quantum) time quantum ,

    time quantum

  • RR

  • RR P1P2P1P3P2P4P5P2P4P5P2P40123456789 1011121314151617181920P1P2P3P4P5P1P2P3P4P5Process IDArrival timeService time(Processing time)P1P2P3P4P50135637253

  • SJF(Shortest Job First) nonpreemptive scheduling (waiting time) , (indefinite postponement) (aging) (estimation)

  • SJF Process IDArrival timeService time(Processing time)P1P2P3P4P50135637253

  • SRTN (Shortest-Remaining-Time-Next) SJF preemptive scheduling .

  • Priority SchedulingCPU , FCFS SJF : , , , BURST : (indefinite blocking)/ (starvation) CPU : aging

  • Multilevel Queue Scheduling , , ) foreground( ): background( ): FCFS (preemptive) : CPU 80% : CPU 20%

  • Multilevel Queue Scheduling

  • (MFQ)Multi-level feedback queue scheduling MFQ (Feedback) (multi-level feedback queue)

  • MFQ dynamic priority preemptive schedulingI/O-bound process SJF, SRTN,

  • ProcessorcompletionhigherprioritylowerpriorityRQ0RQ1RQ2RQntimerrunoutMFQ

  • Example of Multilevel Feedback QueueThree queues: Q0 time quantum 8 millisecondsQ1 time quantum 16 millisecondsQ2 FCFSSchedulingA new job enters queue Q0 which is served FCFS. When it gains CPU, job receives 8 milliseconds. If it does not finish in 8 milliseconds, job is moved to queue Q1.At Q1 job is again served FCFS and receives 16 additional milliseconds. If it still does not complete, it is preempted and moved to queue Q2.

  • MFQ MFQ MFQ - , - - - - (aging) -

  • HRN SchedulingBrinch Hansen SJF . = ( + ) / Nonpreemptive scheduling . .

  • Multiple-Processor SchedulingCPU (homogeneous system) (load sharing) (heterogeneous system) master/slave structure

  • Real-time Scheduling (Hard Real-Time System) (Soft Real-Time System)

  • Real-time schedulingSofthardStaticDynamicCentralizedDistributedCentralizedDistributed

  • Algorithm Evaluation ) ? , , ,

  • Evaluation of CPU Schedulers by Simulation