How To

What are process queues and difference with process states?

process queues

Process Queues

When a process is represented in terms of states, they are actually represented in process queues. These queues are generally implemented as Linked Lists.

Now as we already know about process states, here in process queues almost every state defines or represents a queue. Let us understand the whole concept with the help of the following diagram:

process queues

Point 1: Before entering the ready queue, a process is put into “Job Queue” and this process is done by “Long-term scheduler“.

Point 2: After that when the process is in the ready queue, from there it is scheduled by “Short-term scheduler” to make it available to CPU and then after that, there are several options to be considered.

Point 3: If while being entertained by the CPU, there comes an I/O request for the process or by the process then in that case it is blocked from CPU access and its control is given to that I/O device, from there after fulfilling the I/O request the process again goes to “Ready Queue”.

Point 4: If there occurs some other event, then the process is put into “Event Queue”, from there after the completion of the event process again goes to “Ready Queue”.

Point 5: If the scheduling performed by the “Short-term scheduler” is of time-based or priority based then an occurrence of higher priority event or lower time event can block the current execution of process and the process goes on.

Point 6: If the currently executing process demands for or executes a fork() system call then in that case “Parent Process” has to wait until the “Child Process” is completed.

Point 7: If there is a case of “Suspension of a process” then, in that case, the process goes to “Suspend Queue” and from there it again re-scheduled by “Mid-term scheduler“.

Summary: From the topic covered we have understood the concept of “process queues” and some concepts related to “process schedulers” and we will discuss them in deep in future posts.

Comment here