2.1.6

Scheduling

Test yourself

Scheduling

Operating systems use schedulers to manage the jobs that are being completed by the CPU to ensure maximum use of processing time.

Illustrative background for SchedulingIllustrative background for Scheduling ?? "content

Scheduling

  • Computers are now faster than ever and we expect them to do more and more complex tasks at the same time.
  • We also expect no delay or impact on performance.
  • Scheduling is a system that is part of the operating system that helps to make this happen.
Illustrative background for Types of schedulingIllustrative background for Types of scheduling ?? "content

Types of scheduling

  • There are several key schedulers to be aware of:
    • Round robin.
    • First come first served.
    • Multilevel feedback queues.
    • Shortest job first.
    • Shortest remaining time.

Types of Scheduling

Operating systems use schedulers to manage the jobs that are being completed by the CPU to ensure maximum use of processing time.

Illustrative background for Round robinIllustrative background for Round robin ?? "content

Round robin

  • Round robin is the most basic of scheduler.
  • In this system each time a job comes in to be completed it is added to the end of a queue.
  • Each job is given an amount of CPU time to be completed in.
Illustrative background for Round robin cont.Illustrative background for Round robin cont. ?? "content

Round robin cont.

  • If the job completes within this time, then the next job is loaded.
  • If the job is not completed, then it is pushed to the bottom of the queue and waits for its next slot of CPU time.
    • This is fine if all the jobs are similar in size and similar in priority.
  • This system ignores any priority of a job and ignores that each job will take different amounts of time so can be very inefficient.
Illustrative background for First come first served (FCFS)Illustrative background for First come first served (FCFS) ?? "content

First come first served (FCFS)

  • First come first served (FCFS) is another scheduler that is easy to set up and manage.
  • As jobs come in to be completed, they are added to a queue.
  • Jobs are completed in the order they came in regardless of the time taken to complete.
Illustrative background for First come first served (FCFS) cont.Illustrative background for First come first served (FCFS) cont. ?? "content

First come first served (FCFS) cont.

  • This system is very easy to set up and great for getting things done in the set order of arrival.
  • This system can cause a long delay in getting jobs done, especially if higher up jobs in the queue are big tasks that take a long time.
  • First come first served scheduling generates bad performance within a computer system.
Illustrative background for Multilevel feedback queuesIllustrative background for Multilevel feedback queues ?? "content

Multilevel feedback queues

  • Multilevel feedback queues are the most complex form of scheduling but also give the best results.
  • The scheduler maintains many queues of jobs, usually grouped by priority and similarity of job.
  • The CPU will switch between queues to get jobs to complete.
Illustrative background for Multilevel feedback queues cont.Illustrative background for Multilevel feedback queues cont. ?? "content

Multilevel feedback queues cont.

  • If a job is waiting too long in one queue it will be moved to a higher priority location in another queue to get the job completed quicker.
  • Each separate queue has its own scheduler to maintain that queue.
  • This system offers the best results, but is very CPU intensive.

Types of Scheduling

Operating systems use schedulers to manage the jobs that are being completed by the CPU to ensure maximum use of processing time.

Illustrative background for Shortest job firstIllustrative background for Shortest job first ?? "content

Shortest job first

  • Shortest job first is a scheduler that selects the shortest job in the queue to complete first.
  • Shortest job first can have the shortest waiting time of all the schedulers.
Illustrative background for Shortest job first cont.Illustrative background for Shortest job first cont. ?? "content

Shortest job first cont.

  • As it is always looking for the shortest job first, larger processes can face “starvation” and not get completed.
  • Shortest job first is not very feasible for implementation as the operating system rarely knows the amount of time to complete each new job.
  • The operating system has to use estimation based on a record of all previous jobs.
Illustrative background for Shortest remaining timeIllustrative background for Shortest remaining time ?? "content

Shortest remaining time

  • Shortest time remaining is a preemptive version of shortest job first.
  • As a job arrives, it is compared to the currently running job (which is currently the shortest job) if it is longer than the current job then it is added to a queue.
  • If the new job is shorter than the current job, then the current job is pushed to the queue and the new job is worked on.
Illustrative background for Shortest remaining time cont.Illustrative background for Shortest remaining time cont. ?? "content

Shortest remaining time cont.

  • As a job completes, the scheduler assesses the queue and selects the next shortest job to complete.
  • This scheduler requires very little CPU usage as it only makes a comparison as a job arrives or as it completes a job.
  • Short jobs are always completed quickly, but bigger jobs will face starvation.

Jump to other topics

1Components of a Computer

2Software & Software Development

3Exchanging Data

4Data Types, Data Structures & Algorithms

5Legal, Moral, Cultural & Ethical Issues

6Elements of Computational Thinking

6.1Thinking Abstractly

6.2Thinking Procedurally

6.3Thinking Logically

7Problem Solving & Programming

8Algorithms

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson