A process requires resources like CPU time, memory, and I/O devices to execute. It can be in different states like ready, running, waiting, or terminated. The operating system uses different schedulers like long-term, short-term, and medium-term schedulers to manage processes and allocate resources. The short-term scheduler selects which process runs next using a scheduling algorithm to optimize criteria like CPU utilization, throughput, turnaround time, waiting time, and response time while maintaining fairness.
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
16 views
Operating Processes
A process requires resources like CPU time, memory, and I/O devices to execute. It can be in different states like ready, running, waiting, or terminated. The operating system uses different schedulers like long-term, short-term, and medium-term schedulers to manage processes and allocate resources. The short-term scheduler selects which process runs next using a scheduling algorithm to optimize criteria like CPU utilization, throughput, turnaround time, waiting time, and response time while maintaining fairness.
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26
PROCESS
A process is an instance of a program in
execution. It needs certain resources such as CPU time, memory, files and I/O devices. It also needs to request for all the resources needed. As the request is granted by the operating system, these resources are used and then released when the process ends. A program may contain many processes which may be sequentially executed. The program by itself is not considered a process because it is a passive entity found in a file on a disk The process is an active entity which is already in execution and as it executes. Each process may be in one of the following states: • New or Held a process which has just been created and has not yet been loaded in memory Each process may be in one of the following states: • Ready a process that is allocated a space in the primary storage and waiting to be dispatched to the processor. These ready processes are placed in a queue so that the operating system can keep track which of the processes will be selected for execution. Each process may be in one of the following states: • Running - a process instruction being executed, was allotted time in the processor. The running process may lose its time in the processor for some reasons and may either be transferred back to the ready queue, to the waiting queue for an event completion; or release by the operating system. Each process may be in one of the following states: • Blocked or Waiting - a process waiting for some events to occur (like I/O completion) before it can continue executing. It does not require services of the processor until the blocking event is completed. • Exit, Halted or terminated PROCESS STATE TRANSITION DIAGRAM PROCESS SCHEDULER Scheduling affects the performance of the system because it determines which processes will wait and which will progress. Scheduling is a matter of managing queues to minimize queuing delay and to optimize performance in a queuing environment. PROCESS SCHEDULER Operating system features three types of schedulers namely Long-term or job or admission scheduler, short-term or CPU scheduler and medium-term or midterm scheduler. The names connote that frequency with which the function is used. TYPES OF SCHEDULER Long term Schedulers The Long-term scheduler is responsible for choosing jobs or processes to be admitted and placed in the ready queue. It controls the degree of multiprogramming, that is the number of jobs or processes which can be admitted in the ready queue at a given time. Long term Schedulers It picks out jobs to be admitted based on certain criteria like memory capacity, priority, burst time, etc. A mix of I/O intensive (I/O bound) jobs and CPU intensive (CPU bound) jobs are considered so that components within the computer system are given equal share of work. Long term Schedulers If all jobs entering are I/O intensive, the CPU will be idle most of the time while the I/O queue traffic will be heavy. On the other hand, if all jobs entered are CPU intensive, the CPU will be very busy while I/O devices will be idle. Hence, a well-balanced job mix is required for greater system efficiency. Short term Scheduler The short term, dispatcher or CPU scheduler is responsible for choosing jobs or processes to be executed or allotted the CPU. It creates decision more frequently than the long-term or medium-term scheduler and sees to it that processes coming in are able to finish on or before the deadline. Medium-Term Scheduler The medium term scheduler serves as a swapper of processes from primary storage to secondary storage or vice-versa. It is available in systems with virtual memory. It is responsible for "swapping-in" and "swapping-out" processes. BASIC CONCEPTS IN PROCESS SCHEDULING
CPU Scheduling refers to the sequence or
order of process execution as they are allotted the processor. The scheduler assigned to do the task is the short-term scheduler. BASIC CONCEPTS IN PROCESS SCHEDULING The many ways of allotting the processor to a specific job or process is known as the CPU scheduling algorithm. The main purposes of scheduling algorithms are to minimize resource starvation and to ensure fairness among the parties utilizing the resources. BASIC CONCEPTS IN PROCESS SCHEDULING Evaluation of the best CPU scheduling algorithm takes into account the following criteria: 1. Increase CPU utilization. The main goal is to make the CPU busy processing at all times. CPU utilization is the ratio of the total CPU burst and the total time used up for processing all the jobs in the ready queue. BASIC CONCEPTS IN PROCESS SCHEDULING Evaluation of the best CPU scheduling algorithm takes into account the following criteria: 1. Increase CPU utilization. It is the percentage of time the processor is busy. The greater the CPU utilization, the better the performance of the specific CPU scheduling algorithm. BASIC CONCEPTS IN PROCESS SCHEDULING 2. Increase throughput. Throughput refers to the number of processes that has completed their execution per time unit. It measures how much work is being performed in a given time. This is dependent on the average length or burst time of a process and may also be influenced by the scheduling algorithm. More processes completing in a given time would mean greater throughput. BASIC CONCEPTS IN PROCESS SCHEDULING 3. Reduce Turn-around time. Turn-around time is the amount of time to execute particular processes. It refers to the time when the process was submitted up to its time of completion. It includes actual execution time and time spent waiting for the resources. Shorter turn-around time is better. BASIC CONCEPTS IN PROCESS SCHEDULING 4. Reduce Waiting time. Waiting time refers to the amount of time a process has been waiting in the ready queue before it was allotted the processor. A shorter waiting time is better for all processes. BASIC CONCEPTS IN PROCESS SCHEDULING 5. Reduce Response time. Response time is the amount of time it takes when a request was submitted till the first response is produced. Shorter response time is better. BASIC CONCEPTS IN PROCESS SCHEDULING According to J. Archer Harris, other scheduling criteria which may be considered are balanced utilization, predictability, fairness and priorities. 6. Balanced Utilization evaluates the percentage utilization of not only the CPU but also the memory, I/O devices, and other system resources. BASIC CONCEPTS IN PROCESS SCHEDULING 7. Predictability refers to consistency in response time. 8. Fairness in scheduling refers to the equal opportunity given to all processes to execute such that no one is allowed to suffer from starvation. 9. Preferential treatment to processes with higher priorities may also be considered as a criterion.