Processes Scheduling (Round Robin, First Come First Served…)

Today I’m gonna talk about the concept of process, the process states and the planification of processes.

A process is an active entity, the unit of measure of an operating system. A job is composed from one or more processes. A thread is the smallest operation in an OS.

There are 2 types of processes:

  1. Independent
  2. Cooperant
  • The independent  process doesn’t affect other processes and is not affected by other processes. It has a deterministic execution (it depens only on the input data) and it’s result is reproducible.
  • The cooperant process can affect other processes, can be influenced by other processes and it doesn’t have a deterministic execution nor a reproducible result.

The process states are: 

  1. ready (the process is ready to run)
  2. waiting (the process was put on hold by a system call and waits to become ready)
  3. running (the CPU is given to the process)

process states

Planification of processes

Goals:

  1. equity
  2. response time
  3. throughput
  4. ressource exploitation 
  5. predictability 
  6. efficiency 
  7. deadlines
  8. avoidance of infinite postponement 

There are three types of planners:

  • High level planners (job planners)
  • Medium level planners (process planners)
  • Dispatcher 

We have to define the term of preemption before enumerating the types of planners.

Preemption is the act of “taking” the CPU from the process that uses it. 

 

 

  1. FCFS (first come first served)
  2. SJF (smallest job first)
  3. RR (round robin)
  4. With priorities 
  5. With multileveled queues 
  6. In real time
  7. Multiprocessor 
  • FCFS

Processes are running order by the time of arrival, meaning that the smaller processes will be neglected. It’s a nonpreemptive planning, it’s considered to be equitable and offers the same throughput as other nonpreemptive planning does. The response time is not lowered.

  • SJF

Smaller processes have a higher priority, meaning that bigger processes will be neglect. But it offers a higher throughput, it’s better for real time systems, gives priority to interactive processes and to those processes witch generate I/O bursts.

  • RR

The Round Robin planning uses time slicing for preemption: every process has less than 10 milliseconds to use the CPU. It’s using a queue where it stores the processes in a circular way: the process forced to let go the CPU goes to the back of the queue and waits  its turn. The time quanta is changed twice a day: during night is bigger, so the background processes can run more efficiently.

  • Priority planning

Every process is stored in a queue with based on priorities. Every process has a certain priority level. The process with the highest priority will have the CPU. The problem is that every low priority process will have to wait ( a lot ). The solution for the given issue is process aging. While the time goes by, the process gets higher priority, so the old small priority processes can get the CPU.

  • Multileveled queue 

Divides the ready queue into more queues. Every queue has a specific planning and between queues there is the priority planning implemented. The processes can migrate from one queue to another.

  • Multiprocessor planning

Here there are 2 major problems:

  1. The type of processors
  2. Type of the planning queue

 

Leave a comment