Operating System Unit 2
Operating System Unit 2
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
Process Concept
For each process there is a Process Control Block, PCB, which stores the following
( types of ) process-specific information, as illustrated in Figure 3.1. ( Specific details
may vary from system to system. )
Digging Deeper: The Linux task_struct definition in sched.h ( See also the top of
that file. )
3.1.4 Threads
The two main objectives of the process scheduling system are to keep the CPU
busy at all times and to deliver "acceptable" response times for all programs,
particularly for interactive ones.
The process scheduler must meet these objectives by implementing suitable
policies for swapping processes in and out of the CPU.
( Note that these objectives can be conflicting. In particular, every time the
system steps in to swap processes it takes up time on the CPU to do so, which
is thereby "lost" from doing any useful productive work. )
3.2.2 Schedulers