What is a scheduler?
Different processes run continuously in an IT system. So that each process can be carried out quickly and appropriately, it is planned by schedulers that can differentiate between processes and sometimes prioritize them.
Process schedulers (“process planners”) have the task of scheduling processes in IT systems. So you tell the processor when which task is to be done and which resources are required for this. A distinction is made between preemptive and cooperative tasks.
In the first case, only a certain period of time is planned from the start in which the CPU is required. In the second case, the tasks run until they turn off or block themselves. Office applications are a classic example of cooperative, non-disruptive processes. Preemptive, interrupting tasks are, for example, program update processes.
Process schedulers work with these strategies
In principle, process schedulers work according to one of the following two strategies: “work-conserving” (“preserving the work”) or “non-work-conserving” (“not preserving the work”). However, the names are a bit misleading. They suggest that it is a question of whether the work done in a process is secured or not.
In fact, the central differentiation criterion is whether the switchover time between processes is so short that it can be neglected or not. A very fast switching time is “work-conserving”. So it’s about the time when the CPU is not working on processes. Since there is only a negligible switchover time, the processor is practically continuously busy and therefore “work-conserving”.
A distinction is made between the following concepts for handling the individual tasks:
- First In, First Out:Processes that come in first are handled first. In the FIFO concept, work is therefore carried out in sequence.
- Shortest-Job-Next:The SJN concept provides that the shortest process that is still pending is done next.
- Eearliest Due Date: TheEDD approach is about getting the tasks done first that need to be done as quickly as possible due to deadlines.
- Priority scheduling:The scheduler decides on the basis of set priorities in which order tasks are to be completed.
It is important with these concepts that it is not necessarily about the “pure” teaching. For example, it can also be the case that concepts are mixed up. For example, if processes run by the same deadline, prioritization is used to determine which process is to be processed first.
Different process scheduler systems
A distinction must be made between the following three process scheduler systems:
- Batch processing:Tasks are processed in sequence. The aim is to ensure that the CPU is never idle and that as many processes as possible are completed. The turnout time (“lead time” of a process) should be as short as possible.
- Interactivity:The response times should be as fast as possible in order to minimize the waiting time for the user. There is therefore a prioritization. Processes that interact with the user are given priority. In addition, the scheduler ensures that the response times generally correspond to the expectations of the user. For example, menus that are called must always load at a comparatively fast rate (“requirement of proportionality”).
- Real time:Here, deadlines are used to ensure predictability. Safety-critical applications (e.g. autopilots) or even multi-media applications rely on the corresponding system to plan processes.
In principle, the goal is always fairness regardless of the process. No process should have to wait long for no reason before it is done. The balance is also important: Not only the CPU should be fully utilized, but also the hard drive, the GPU and the other hardware. All system rules must be adhered to.