0% found this document useful (0 votes)
80 views

Module 3 CPU Process Scheduling

This document provides an overview of CPU process scheduling. It defines CPU scheduling as determining which process will use the CPU for execution. There are two types of scheduling: preemptive, where a higher priority task can interrupt a lower priority one; and non-preemptive, where the CPU is allocated until the process finishes. The goals of scheduling are to maximize CPU utilization and throughput while minimizing waiting time, turnaround time, and response time.

Uploaded by

Mc John Poblete
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

Module 3 CPU Process Scheduling

This document provides an overview of CPU process scheduling. It defines CPU scheduling as determining which process will use the CPU for execution. There are two types of scheduling: preemptive, where a higher priority task can interrupt a lower priority one; and non-preemptive, where the CPU is allocated until the process finishes. The goals of scheduling are to maximize CPU utilization and throughput while minimizing waiting time, turnaround time, and response time.

Uploaded by

Mc John Poblete
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ITEC55 Platform Technologies

Module 3 CPU Process Scheduling

Prepared by:
MAC JOHN T. POBLETE
Faculty, Information Technology Department
Cavite State University Naic
Email: [email protected]
ITEC55 Platform Technologies Module 3 CPU Process Scheduling

In this module, the students must be able to:


a. define CPU scheduling
b. differentiate the two kinds of CPU scheduling
c. define the important terminologies in CPU scheduling
d. determine the CPU scheduling criteria

Instructions:
1. Read carefully all instruction for each task before working on the requirements.
2. All questions related to requirements shall be coursed through email only. Replies will be sent
during office hours.

Pretest:
1. What is CPU scheduling?
2. What are the two kinds of CPU scheduling?
3. What are the different types of scheduling algorithm?

LET US LEARN!
CPU Scheduling
CPU Scheduling is a process of determining which process will own CPU for execution while another process
is on hold. The main task of CPU scheduling is to make sure that whenever the CPU remains idle, the OS at least
select one of the processes available in the ready queue for execution. The selection process will be carried out by the
CPU scheduler. It selects one of the processes in memory that are ready for execution.

Kinds of CPU Scheduling

Figure 1. Kinds of CPU scheduling

Preemptive Scheduling. In Preemptive Scheduling, the tasks are mostly assigned with their priorities.
Sometimes it is important to run a task with a higher priority before another lower priority task, even if the lower priority
task is still running. The lower priority task holds for some time and resumes when the higher priority task finishes its
execution.
Some Algorithms that are based on preemptive scheduling are Round Robin Scheduling (RR), Shortest
Remaining Time First (SRTF), Priority (preemptive version) Scheduling, etc.
ITEC55 Platform Technologies Module 3 CPU Process Scheduling

Non-Preemptive Scheduling. In this type of scheduling method, the CPU has been allocated to a specific
process. The process that keeps the CPU busy will release the CPU either by switching context or terminating. It is the
only method that can be used for various hardware platforms. That’s because it doesn’t need special hardware (for
example, a timer) like preemptive scheduling.
Some Algorithms based on non-preemptive scheduling are: Shortest Job First (SJF basically non-preemptive)
Scheduling and Priority (non- preemptive version) Scheduling, etc.

When scheduling is Preemptive or Non-Preemptive?


To determine if scheduling is preemptive or non-preemptive, consider these four parameters:
1. A process switches from the running to the waiting state.
2. Specific process switches from the running state to the ready state.
3. Specific process switches from the waiting state to the ready state.
4. Process finished its execution and terminated.
Only conditions 1 and 4 apply, the scheduling is called non- preemptive.
All other scheduling are preemptive.

Important CPU scheduling Terminologies


Burst Time/Execution Time: It is a time required by the process to complete execution. It is also called
running time.
Arrival Time: when a process enters in a ready state
Finish Time: when process complete and exit from a system
Multiprogramming: A number of programs which can be present in memory at the same time.
Jobs: It is a type of program without any kind of user interaction.
User: It is a kind of program having user interaction.
Process: It is the reference that is used for both job and user.
CPU/IO burst cycle: Characterizes process execution, which alternates between CPU and I/O activity. CPU
times are usually shorter than the time of I/O.

CPU Scheduling Criteria


A CPU scheduling algorithm tries to maximize and minimize the following:

Figure 2. Scheduling criteria


Maximize
CPU utilization. CPU utilization is the main task in which the operating system needs to make sure that CPU
remains as busy as possible. It can range from 0 to 100 percent. However, for the RTOS, it can be range from 40
percent for low-level and 90 percent for the high-level system.
ITEC55 Platform Technologies Module 3 CPU Process Scheduling

Throughput. The number of processes that finish their execution per unit time is known Throughput. So,
when the CPU is busy executing the process, at that time, work is being done, and the work completed per unit time is
called Throughput.
Minimize
Waiting time. Waiting time is an amount that specific process needs to wait in the ready queue. Waiting Time
= Turn Around Time – Burst Time
Response time. It is an amount to time in which the request was submitted until the first response is produced.
Turnaround Time. Turnaround time is an amount of time to execute a specific process. It is the calculation
of the total time spent waiting to get into the memory, waiting in the queue and, executing on the CPU. The period
between the time of process submission to the completion time is the turnaround time. Turn Around Time = Completion
Time – Arrival Time

Why do we need scheduling?


A typical process involves both I/O time and CPU time. In a uni programming system like MS-DOS, time spent
waiting for I/O is wasted and CPU is free during this time. In multi programming systems, one process can use CPU
while another is waiting for I/O. This is possible only with process scheduling.

Objectives of Process Scheduling Algorithm


Max CPU utilization [Keep CPU as busy as possible]
Fair allocation of CPU.
Max throughput [Number of processes that complete their execution per time unit]
Min turnaround time [Time taken by a process to finish execution]
Min waiting time [Time a process waits in ready queue]
Min response time [Time when a process produces first response]

Post Test
In your own words, what is the importance of scheduling?

References
CPU Scheduling in Operating System | Studytonight. (n.d.). Studytonight.
https://www.studytonight.com/operating-system/cpu-scheduling
GeeksforGeeks. (2021, June 28). CPU Scheduling in Operating Systems.
https://www.geeksforgeeks.org/cpu-scheduling-in-operating-systems/
Operating System - Process Scheduling. (n.d.). Tutorialspoint.
https://www.tutorialspoint.com/operating_system/os_process_scheduling.htm
OS Scheduling Algorithms - javatpoint. (n.d.). Www.Javatpoint.Com.
https://www.javatpoint.com/os-scheduling-algorithms
Williams, L. (2021, October 6). CPU Scheduling Algorithms in Operating Systems. Guru99.
https://www.guru99.com/cpu-scheduling-algorithms.html

You might also like