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:
- Independent
- 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:
- ready (the process is ready to run)
- waiting (the process was put on hold by a system call and waits to become ready)
- running (the CPU is given to the process)
Planification of processes
Goals:
- equity
- response time
- throughput
- ressource exploitation
- predictability
- efficiency
- deadlines
- 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.
- FCFS (first come first served)
- SJF (smallest job first)
- RR (round robin)
- With priorities
- With multileveled queues
- In real time
- 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:
- The type of processors
- Type of the planning queue