AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Types Of Scheduling Algorithms3/21/2021
When a process or thread desires an IO transfer, it usually becomes unable to use the CPU until the transfer is complete.Preemptive and Non-preemptive are major types of CPU scheduling.
Multiprogramming The operating system can make the computer more useful by switching the CPU among multiple processes. The goal of multiprogramming is to hold some processes running at all times. Advertisement If there is only one processor (or CPU) then there will only be one process in a running state at any given time. If there are more processes that require to be run, they will have to stay and wait. There must be some mechanism to select which process (currently in memory) will run next when the CPU becomes available. All the processes in this queue are in a standby position to be executed. Whenever a currently executing process needs to wait (does IO etc.), the operating system picks a process from the ready queue and assigns the CPU to that process. So, it is very important to build up good scheduling algorithms. Suppose we have two processes A and B to be executed. Each and every process executes for one second then holds for one second. CPU Scheduling Objectives Schedulers normally try to achieve some mixture of the following goals. These goals are conflicting to some level: Make the best use of CPU utilization (due to its relatively high cost) Maximize the consumption of other resources (disks, printers, etc.) Maximize throughput number of jobs completed per unit time. Decrease waiting time total time a job spends waiting in the different queues for a resource to become accessible. Minimize rotate time waiting time computation time IO time Reduce response time (timesharing) time from entry of command until the first output starts to appear. In aging, the priority of a process grows as it waits for a resource. The priority slowly becomes highest and it gets the resource. Uniformity: the behavior of the system should be predictable. Graceful degradation: the system response deteriorates gradually rather than coming to a sudden virtual standstill in case of excessive loads. Predictability: a given job should run in about the same amount of time and at about the same cost regardless of system load. Working of CPU Scheduler The process to choose the next job that will run on the CPU belongs to the short-term or CPU scheduler. The CPU scheduler can only select from the jobs that are already in memory and prepared to go. The scheduler works in cooperation with the interrupts system. The scheduler assigns the CPU to act upon calculation on behalf of a specific process or thread within a process.
0 Comments
Read More
Leave a Reply. |