Download presentation
Presentation is loading. Please wait.
1
Process Management with OS
Prepared By: Fatma Said Al-Hosni
2
Outline Introduction Process statues Process Control Block (PCB)
When to schedule Process scheduling algorithms: First come, first served Shortest job first Priority scheduling Shortest remaining time Round robin
3
Introduction When a computer is a multi-programmed, it frequently has multiple processes competing for the CPU at the same time. The part of the operating system that makes the choice is called the scheduler The algorithm it uses is called the scheduling algorithm
4
Process statues As a job moves through the system it’s always in one of five statues (or at least three) as it changes from HOLD to READY to RUNING to WAITING and eventually to FINISHED
5
Process statues
6
Process Control Block (PCB)
Each process in the system is represented by data structure called Process Control Block (PCB). PCB contains information about the job including: What it is? Where it is going? How much of its processing has been completed? Where it is stored? How much it has spent in using resources?
7
When to schedule First, when a new process is created, a decision needs to be made whether to run the parent or the child process Second, a scheduling decision must be made when a process exists Third, when a process blocks on I/O, on a semaphore, or for some other reason, another process has to be selected to run. Fourth, when an I/O interrupts occurs, a scheduling decision may be made
8
Scheduling algorithms can be divided into two categories with respect to how they deal with clock interrupts. Nonpreemptive scheduling algorithm picks a process to run and then just lets it run until it blocks (either on I/O or waiting for another process) or until it voluntarily releases the CPU. Preemptive scheduling algorithm picks a process and lets it run for a maximum of some fixed time
9
Process scheduling algorithms
First come, first served Shortest job first Priority scheduling Shortest remaining time Round robin
10
First come, first served (FCFS)
With this algorithm, processes are assigned the CPU in the order they request. Advantages: Easy to understand Fair Disadvantages: This scheduling method is nonpreemptive, that is, the process will run until it finishes. Because of this nonpreemptive scheduling, short processes which are at the back of the queue have to wait for the long process at the front to finish
11
Shortest job first (SJF)
Shortest job first is a nonpreemptive algorithm that handles jobs based on the length of their CPU cycle time.
12
Priority scheduling This algorithm gives preferential treatment to important jobs. If two or more jobs with equal priority are present in the ready queue, the processor is allocated to the one that arrived first
13
Cont.. Priority scheduling
Priorities can be determined by the Processer Manager based on characteristics intrinsic to the jobs such as: Memory requirements Number and type of peripheral devices Total CPU time Amount of time already spent in the system
14
Shortest remaining time (SRT)
With this algorithm, the scheduler always choose the process whose remaining is the shortest. The run time has to be known in advance.
15
Round robin Round robin is one of the oldest, simplest, fairest, and most widely used algorithms. Each process is assigned a time interval, called its quantum.
16
References Andrew S. Tanenbaum (2001). Modern Operating Systems. 2nd ed. Ann Mchoer, Ida m. (2006). Understanding Operating Systems. 5th ed. M. Garrido, R.Schlesiner (2008). Understanding Modern Operating Brain L.Stuart (2009). Principles of Operating Systems.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.