Skip to content

Process Scheduling Goals and Methods

Overview of process scheduling goals and methods

The goals and methods of process scheduling directly affect the efficiency of resource allocation of the operating system. The main goals include fairness, high efficiency, balance, high throughput and policy enforcement. Different types of operating systems have different focuses on these goals.

Process scheduling goals

  1. Fairness: Ensure that each process can get the CPU execution opportunity fairly to avoid "starvation". To achieve fairness in process execution on the basis of ensuring priority.

  2. High efficiency: Keep the CPU "busy" as much as possible, reduce idle waiting time, and thus improve the utilization of the processor. The formula is as follows:

\[ \text{CPU utilization} = \frac{\text{CPU effective working time}}{\text{CPU effective working time + CPU idle waiting time}} \]
  1. Balance: There are different types of processes in the system (such as computing and I/O types). The scheduling algorithm should ensure load balance between the CPU and other resources to avoid idle resources.

  2. High throughput: Improve the processing capacity of the system and make the waiting time of each process as short as possible, thereby increasing the number of processes completed per unit time.

  3. Policy enforcement: Strictly implement the predetermined scheduling strategy, including security strategy, even if it will cause some work delays.

Scheduling goals of different systems

  • Multi-channel batch processing system: The focus is on efficient use of system resources, improving throughput and shortening the average turnaround time.

  • Time-sharing operating system: Pay more attention to user fairness and timely responsiveness, usually using time slice round-robin scheduling algorithm, frequent task switching increases system overhead.

  • Real-time operating system: Ensure timely response of real-time processes, the scheduling algorithm is characterized by preemptibility, ensuring that real-time tasks are executed on time.

  • General operating system: Mainly pursue fairness and balance in resource use, without special scheduling requirements.

Process scheduling method

  1. Non-preemptive method:

    • In this method, once a process obtains CPU control, it can run until it is completed or blocked, and then hand over the processor to other processes.
      • Advantages: Simple implementation, low system overhead, suitable for batch processing systems.
      • Disadvantages: Unable to cope with real-time task requirements and cannot meet strict response time requirements.
  2. Preemptive method:

    • The scheduler can interrupt the running process according to specific principles (such as priority, short process priority, time slice rotation) and allocate the CPU to other more needed processes.
  3. Preemptive principle:
    • Priority principle: A high-priority process can interrupt a low-priority process.
    • Short process priority principle: A short process can preempt the execution of a long process.
    • Time slice principle: Each process takes turns to occupy the CPU according to the time slice, and switches to the next process when the time slice is up, which is suitable for time-sharing systems.

Different scheduling methods are suitable for different scenarios. In real-time systems, preemptive methods are usually used to ensure that key tasks are completed on time; in batch systems, non-preemptive methods are tended to be used to reduce system overhead.