(This is the older material - click here - for current specification content)

4. Process in Queues

Most programs or processes will be interacting with some kind of Input-Output hardware.

For example a process might be waiting for an user to enter a value via the keyboard. Or it might be wanting to send data to the sound system.

In this case, whilst the process is waiting, the CPU could be getting on with doing something else.

For example, consider a process with ID 123 waiting for a keyboard input. That process is set to WAITING status and stored by the scheduler in the WAIT / BLOCKED queue. You can see it at the top of the WAIT / BLOCKED queue below.

Process wait queue

Process ID 123
Owner ID
D Smith
Current priority
20
Status WAITING
Registers Content of the CPU when last run
Units of processing time used 50
Awaiting resource Keyboard Input
Link to other PCB Process 3

 

Meanwhile, when the peripheral is ready to supply some data, the input-output device (keyboard) issues an interrupt to the CPU to let it know that it is ready to be handled.

In this case, the scheduler will change the status of the process to 'READY'. The scheduler transfers the process to the READY queue by simply altering the "link to other PCB" link in the process PCB table, so switching between queues is very quick.

process ready queue

Process ID 123
Owner ID
D Smith
Current priority
20
Status READY
Registers Content of the CPU when last run
Units of processing time used 50
Awaiting resource NONE
Link to other PCB Process 1

So the scheduler can move processes from one queue to another in reaction to an interrupt or some other signal.

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Process Queues

 

 

 

Copyright © www.teach-ict.com