teach-ict.com logo

THE education site for computer science and ICT

2. Polling

The CPU needs to react to events.

pollingOne method of doing this is for the CPU to keep checking devices or events to see if they need attention. For instance a file may need to be sent to the printer.

This method is called 'polling'.

Polling is the regular checking of an event to see whether it has occurred.

Imagine parents driving somewhere with an impatient child sitting in the back seat. The child keeps asking "Are we there yet, Are we there yet, Are we ..." You get the idea.

The child is 'polling' the parent over and over again. This works, but it is inefficient as most of the time the answer is 'No' and yet time is taken up answering the question.

A similar thing happens in the CPU where the program currently running will be checking regularly to see if any related peripherals or events require additional attention.

The advantage of polling is that it is very simple and predictable, as polling only occurs at specific points while software runs.

The disadvantage of polling is that it may be inefficient in terms of using up CPU processing time.

 

Polling: the CPU or program regularly checks to see if an event or peripheral needs attention. It it does, then the related polling task is carried out.

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

Click on this link: What is software polling