Polling (computer science)

Polling, or interrogation, refers to actively sampling the status of an external device by a client program as a synchronous activity.

Uses your system voice; voice and rate in settings.

Snapshot

≈ 2 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

Polling, or interrogation, refers to actively sampling the status of an external device by a client program as a synchronous activity. Polling is most often used in terms of input/output ( ), and is also referred to as polled or software-driven . A good example of hardware implementation is a watchdog timer.

Description

Polling is the process where the computer or controlling device waits for an external device to check for its readiness or state, often with low-level hardware. For example, when a printer is connected via a parallel port, the computer waits until the printer has received the next character. These processes can be as minute as only reading one bit.

This is sometimes used synonymously with 'busy-wait' polling. In this situation, when an operation is required, the computer does nothing other than check the status of the device until it is ready, at which point the device is accessed. In other words, the computer waits until the device is ready.

Polling also refers to the situation where a device is repeatedly checked for readiness, and if it is not, the computer returns to a different task. Although not as wasteful of CPU cycles as busy waiting, this is generally not as efficient as the alternative to polling, interrupt-driven .

In a simple single-purpose system, even busy-wait is perfectly appropriate if no action is possible until the access, but more often than not this was traditionally a consequence of simple hardware or non-multitasking operating systems. Polling is often intimately involved with very low-level hardware.

For example, polling a parallel printer port to check whether it is ready for another character involves examining as little as one bit of a byte. That bit represents, at the time of reading, whether a single wire in the printer cable is at low or high voltage.

The instruction that reads this byte directly transfers the voltage state of eight real world wires to the eight circuits (flip flops) that make up one byte of a CPU register. Polling has the disadvantage that if there are too many devices to check, the time required to poll them can exceed the time available to service the I/O device.

See also

Abstraction (computer science) Asynchronous I/O Bit banging Infinite loop Interrupt request (PC architecture) Integer (computer science) kqueue Pull technology select (Unix) Signal (IPC)

References

fr:Attente active

Text derived from https://en.wikipedia.org/w/index.php?oldid=1329389052 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

1 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.