Two-level scheduling in Operating Systems Last Updated : 12 Aug, 2020 Comments Improve Suggest changes Like Article Like Report Two-level scheduling is an efficient scheduling method that uses two schedulers to perform process scheduling. Let us understand it by an example : Suppose a system has 50 running processes all with equal priority and the system's memory can only hold 10 processes simultaneously. Thus, 40 processes are always swapped out and written on virtual memory on the hard disk. To swap out and swap in a process, it takes 50 ms respectively. Let us take up the above scenario with straightforward Round-robin scheduling: a process would need to be swapped in (least recently used processes are swapped in) every time when a context switch occurs. Swapping in and out costs too much, and the unnecessary swaps waste much time of scheduler. So the solution to the problem is two-level scheduling. There are two different schedulers in two-level scheduling : 1. Lower level scheduler 2. Higher level scheduler Lower level scheduler - This scheduler selects which process will run from memory. Higher level scheduler - This scheduler focuses on swapping in and swapping out the processes between hard disk and memory. Swapping takes much time, therefore it does its scheduling much less often. It also swaps out the processes which are running for a long time in memory and are swapped with processes on disk that have not run for a long time. Following variables are used : Response time - Response time variable is important as it prevents resource starvation and a process will be completed. Some other processes will have to wait unnecessarily for a long time if a process is swapped out for too long. Therefore, this variable is essential. Size of the process - Larger processes are less often swapped because they take a long time to swap. As these processes are larger, only some of them can share the memory with the process. Priority - The process with higher priority stays in memory for longer time so that it completes faster. Comment More infoAdvertise with us Next Article Two-level scheduling in Operating Systems N nikitadabral30 Follow Improve Article Tags : Operating Systems Operating Systems-CPU Scheduling Similar Reads I/O scheduling in Operating Systems Input/Output (I/O) operations are how a computer communicates with external devices such as hard drives, keyboards, printers, and network interfaces. These operations involve transferring data into and out of the system whether itâs reading a file, saving a document, printing, or sending data over a 6 min read List scheduling in Operating System Prerequisite - CPU Scheduling List Scheduling also known as Priority List Based Scheduling is a scheduling technique in which an ordered list of processes are made by assigning them some priorities. So, basically what happens is, a list of processes that are ready to be executed at a given point is 3 min read CPU Scheduling in Operating Systems CPU scheduling is a process used by the operating system to decide which task or process gets to use the CPU at a particular time. This is important because a CPU can only handle one task at a time, but there are usually many tasks that need to be processed. The following are different purposes of a 8 min read Linear Scheduling Method in Operating System Linear Scheduling Method is graphical technique in which horizontal axis is used to represent length of linear project, and vertical axis represents duration of project's activities. It is also known as distance-time scheduling. Every activity is mapped sequentially on graph, depending on sequence o 3 min read Long Term Scheduler in Operating System Pre-requisites: Process Schedulers in Operating System A long-term scheduler, also known as a job scheduler, is an operating system component that determines which processes should be admitted to the system and when. It is used in batch processing systems and operates at a high level. The long-term 3 min read Like