/ COMPUTER-FUNDAMENTAL

Process scheduling algorithm

Scheduling algorithm


Process has state.
New, Ready, Running, Waiting, and Terminated.

  • New : The process is being created
  • Terminated : The process has finished execution
  • Running : Instructions are being executed
  • Waiting : The process is waiting for some event to occur
  • Ready : The process is waiting to be assigned to a process

For example, we start a game program.
The game process is on Running state, But we should login.
In login page, CPU changes the state to “Waiting” because the login page is not working until login is finish.
CPU put another process on “Running” state instead.
In this state, when we login the game, Process send Interrupt message to CPU.
CPU changes the game process state to “Ready”.

The “Ready” Process can be “Running” when CPU allows it.
When CPU chooses a Process to “Running”, CPU uses “Scheduling”.
After CPU chose the Process to be “Running”, CPU uses “Dispatcher” to put the process on CPU.
And then, the Process is running.


Process Scheduling

It re-schedules the order of “Ready queue” Processes.
The scheduled Processes will be running in the order.

  • Scheduling : when CPU chooses “Ready” Process
  • Dispatch : when CPU put the process on CPU

Scheduling Criteria

It is a criteria when scheduling algorithm judges what the good is or what the bad is.

  1. CPU Utilization
    How useful when CPU is working
  2. Throughput
    How many processes CPU can instruct per second (about CPU clock, Htz)
  3. Turnaround time
    How fast CPU can finish the Process
  4. Waiting time
    How long the “Ready” Process waits to be “Running”
  5. Response time
    How fast Process respond what is going on.
    Usually when Process handles really heavy work, It lets the user know the Process’s state.

    Times are better when it is faster.
    Throughput and CPU utilization is better when it has more and more.

Scheduling is everywhere
Disk(HDD, SSD) has Disk scheduling. It Schedules Which Data will go first.

Database has database scheduling. It schedules which transaction will go first.

Network has network scheduling. It schedules which packets will go first.