29-03-2012, 03:08 PM
CPU Scheduling
cpu_scheduling.pdf (Size: 169.08 KB / Downloads: 84)
1. Introduction
This paper researches CPU scheduling, which is one of the areas of operating systems. Several topics related to CPU scheduling, such as processes and threads, are highlighted. A detailed discussion about CPU scheduling is provided, along with its implementation in Linux 2.6.8.1 and Windows XP.
2. CPU Scheduling Overview
By definition, CPU scheduling is a decision mechanism of the operating system to establish priorities among processes, which are ready to run, and the assignment of these processes to the CPU (central process unit) by order of priority through software, called a scheduler. As such, CPU scheduling is fundamental to the design of operating systems [1, 2].
CPU scheduling is the basis of computer multitasking and multiprocessing operating systems, as well as a key concept for real-time operating systems. Generically, one could say that multitasking is a method by which multiple processes share resources such as a CPU, and multiprocessing is a term used when a single computer system has two or more central CPUs. Also, it is understood that real-time operating systems are intended for real-time applications. Examples include programmable thermostats, household appliance controllers, mobile telephones, industrial robots, and scientific research equipment. These applications have in common that system deadlines can be met generally ("soft real-time") or deterministically ("hard real-time") to guarantee the finished product will be real-time [2].
Computer productivity and CPU utilization can be accomplished by CPU scheduling. A computer system will increase its productivity and CPU utilization if the switch of the CPU among processes and selection of the CPU scheduling algorithms are done according to the purpose or nature of the operating system. When a process is assigned to the CPU to run, it must execute until it must wait
- Page 1 -
Term Paper: CPU Scheduling CISC 421: Operating Systems
Summer 2006
for completion of an I/O request for instance. Since waiting time is not useful, another process should be assigned to the CPU to make the computer system productive. This is the concept of multiprogramming, which is essential for making a computer system productive. The CPU scheduling algorithms will be discussed later [1].
3. Processes and Threads
Before continuing the discussion on CPU scheduling, a brief description of programs, processes, and threads is provided.
A program is a combination of instructions and data to perform a task. Programs are like classes as defined in programming languages, such as Java [3].
A process is an instance of a program. Processes are like objects (i.e., instances of classes) as defined in programming languages, such as Java. They are instantiated to embody the state of a program during its execution. As such, processes keep track of the data that is associated with a thread or threads of execution, which includes variables, registers, program counter, contents of an address space (i.e., a set of memory addresses that a process is allowed to read and/or write to), etc. [3]. The following are distinct states of a process when it executes: