1 / 7

CPU Scheduling ( Basic Concepts)

CPU Scheduling ( Basic Concepts). CPU scheduling Which process will get the CPU when it is available? This is decided by the O.S. and is called CPU scheduling. The part of the O.S. which performs scheduling is called Scheduler.

montenegro
Télécharger la présentation

CPU Scheduling ( Basic Concepts)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPU Scheduling ( Basic Concepts) CPU scheduling • Which process will get the CPU when it is available? This is decided by the O.S. and is called CPU scheduling. • The part of the O.S. which performs scheduling is called Scheduler. • The scheduler selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. • The objective is to maximize CPU utilization in multiprogramming. CPU–I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

  2. Alternating Sequence of CPU And I/O Bursts execute CPU Burst I/O Wait I/O Burst execute CPU Burst I/O Wait I/O Burst

  3. Important Definitions

  4. Optimization Criteria • Max CPU utilization • Max throughput • Min turnaround time • Min waiting time • Min response time

  5. Scheduling Algorithms • First-Come, First-Served (FCFS) Scheduling ( non preemptive) • This algorithm favors: • Longer jobs against the shorter jobs ( W/B is less for longer jobs) • CPU bound processes against I/O bound processes

  6. Shortest Job first Scheduling Now the jobs appear as: • Now: • Longer jobs are not favored against the shorter jobs ( W/B is less for longer jobs) • A longer job can face starvation • CPU bound processes are still favored against I/O bound processes

  7. Round-Robin (RR) Scheduling (Preemptive) • A queue of ready processes is maintained • A time quantum q (10-100 msec) is allocated to each process. • I f a process does not finish in the allocated time it goes back to the end of the queue (circular queue) • If there are n processes, each process gets turn at most after (n-1) q units. Gannt Chart for q = 20 msec CPU CPU • Performance • If q is large, this scheme degenerates to FCFS • If q is small, more context switches (each process finishes in more turns)

More Related