??? CPU Scheduling - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

??? CPU Scheduling

Description:

CPU Scheduling (Scheduling Criteria ) (Scheduling Algorithms) (Multiple-Processor Scheduling) – PowerPoint PPT presentation

Number of Views:169
Avg rating:3.0/5.0
Slides: 35
Provided by: MarilynT6
Category:
Tags: cpu | scheduling

less

Transcript and Presenter's Notes

Title: ??? CPU Scheduling


1
??? CPU Scheduling
  • ????
  • ????(Scheduling Criteria )
  • ?????(Scheduling Algorithms)
  • ???????(Multiple-Processor Scheduling)
  • ????(Real-Time Scheduling)
  • ?????(Algorithm Evaluation)

2
????
  • CPU??????CPU????(CPU utilization)
    ????????(multiprogramming)???multiprogramming
  • CPU Burst Cycle?I/O Burst Cycle
  • ???????????CPU??????????????.
  • CPU burst???(distribution)

3
CPU And I/O Bursts?????
4
CPU-burst ??????????(histogram)
5
CPU ???
  • ????????????????????????,??CPU???.
  • CPU???????????????????
  • ?????(running)?????(wait)???.
  • ?????(running)?????????(ready)???.
  • ?????(wait)?????????(ready)???Switches from
    waiting to ready.
  • ??(terminate).
  • ??????????1?4????, ?????????(non-preemptive,??????
    ).
  • ???????CPU???????????(preemptive).

6
???(Dispatcher)
  • ??????????,??CPU?????????????????,?????
  • switching context
  • ????????
  • ??????????????????????
  • ????(Dispatch latency)
  • ??????????????????????????.

7
????
  • CPU????(utilization)
  • ????CPU??
  • ??(Throughput)
  • ??????????????
  • ????(Turnaround time)
  • ????????????
  • ????
  • ????????ready queue???
  • ????(Response time)
  • ??????(time-sharing),?????????,
    ?????????????????(????????????)

8
?????
  • ??CPU???
  • ????(throughput)
  • ??????(turnaround time)
  • ??????(waiting time)
  • ??????(response time)

9
????(FCFS)???
  • Process Burst Time
  • P1 24
  • P2 3
  • P3 3
  • ???????????? P1 , P2 , P3
  • ????????(Gantt Charts)
  • ?????????P1 0 P2 24 P3 27
  • ??????? (0 24 27)/3 17

10
????(FCFS)???(Cont.)
  • ?????????
  • P2 , P3 , P1 .
  • ?????Gantt chart ?
  • ?????????P1 6 P2 0 P3 3
  • ???????(6 0 3)/3 3
  • ?????????
  • ?????(convoy effect), ???????????????CPU??????????
    , ??????????????.

11
?????? (SJF) ???
  • ?????????????CPU burst?????. ??????????????CPU
    burst???????CPU??.
  • ?????
  • ?????(nonpreemptive)
  • ??CPU????????, ???????????????, ?????CPU burst??.
  • ????(preemptive)
  • ???????CPU burst???????????????CPU burst?????,
    ????????????????????(preempt). ???????????????????
    ?(Shortest-Remaining-Time-First, SRTF).
  • SJF????????
  • ???????????????????????.

12
????????? SJF??
  • Process Arrival Time Burst Time
  • P1 0.0 7
  • P2 2.0 4
  • P3 4.0 1
  • P4 5.0 4
  • SJF (non-preemptive)
  • Average waiting time (0 6 3 7)/4 4

13
???????? SJF??
  • Process Arrival Time Burst Time
  • P1 0.0 7
  • P2 2.0 4
  • P3 4.0 1
  • P4 5.0 4
  • SJF (preemptive)
  • Average waiting time (9 1 0 2)/4 3

14
???CPU burst ?????
  • ??????? estimate the length.
  • ???????CPU burst??????,??????????(exponential
    averaging).

15
???CPU burst?????
16
????????
  • ? 0
  • ?n1 ?n
  • ??????CPU burst??.
  • ? 1
  • ?n1 tn
  • ???????????CPU burst??.
  • ????????,????
  • ?n1 ? tn(1 - ?) ? tn -1
  • (1 - ? )j ? tn -1
  • (1 - ? )n1 tn ?0
  • ????(1 - ?)?????? 1,???????????????????????.

17
?????????
  • ?????????????????
  • CPU???????????? (??????????????).
  • Preemptive
  • nonpreemptive
  • SJF??????????????CPU burst?????????????.
  • ????????Starvation
  • ???????????????.
  • ?????Aging
  • ????????????????????.

18
?????????(Round Robin,RR)
  • ?????????????CPU??(?????time quantum), ???10-100
    milliseconds. ???????, ???????????????ready
    queue???.
  • ???n????ready queue?????????? q,?????????????q????
    ???1/n?CPU time.????????? (n-1)q??.
  • ??
  • q??? ? FIFO
  • q??? ? ???context switch??????,q?????,??context
    switch????????????.

19
?????20????????????
  • Process Burst Time
  • P1 53
  • P2 17
  • P3 68
  • P4 24
  • The Gantt chart is
  • ????, ?SJF??????????(turnaround than SJF),
    ??????????.

20
??????Context Switch ??
21
??????????????(Turnaround Time)???
22
?????(multi-level queue)??
  • Ready queue????????queues
  • ??, foreground (interactive)
  • ??,background (batch)
  • ???queue?????????
  • foreground RR
  • background FCFS
  • ????queue?????.
  • ???????(Fixed priority scheduling)
  • ???????, ???????
  • ??????starvation.
  • ????(time slice)
  • ???queue????????CPU??, ??????queue???????????
  • ??80CPU?????queue?RR???, 20 ???queue?FCFS??

23
???????
24
???????(multi-level feedback queue)
  • ?????????queue???
  • aging ??????????.
  • ???????????????????
  • queues???
  • ??queue??????
  • ??????????????queue???
  • ??????????????queue???
  • ??????????, ?????????queue???

25
???????????
  • ??queue
  • Q0 time quantum 8 milliseconds
  • Q1 time quantum 16 milliseconds
  • Q2 FCFS
  • ????
  • ???????????????Q0,????CPU???, ??8
    milliseconds????.????? 8 milliseconds??,?????Q1.
  • ????????????Q1???????16 milliseconds?CPU????.?????
    ???????,??????????Q2.

26
Multi-level Feedback Queues
27
??????(Multiple-Processor Scheduling)
  • ????????.
  • ???????????????????(Homogeneous)????.
  • ????(Load sharing)
  • ????????
  • ?????????????????, ???????????????????.

28
?????(Real-Time Scheduling)
  • ?????(Hard real-time systems)
  • ???????????????????.
  • ???(Soft real-time computing)
  • ?????????????????????????

29
????(Dispatch Latency)
30
????????
  • ???????(Deterministic modeling)
  • ?????????????????(workload) ??????????????????????
    .
  • ??????(Queueing models)
  • ??(Implementation)

31
????????CPU???????
32
Solaris 2 ???
33
Windows 2000 ????
34
???????
Write a Comment
User Comments (0)
About PowerShow.com