Polling

This is most often used in terms of O.

I heard this term used at NVIDIA. This is related to Messaging Pattern.

Polling or a polled operation denotes the process of a client program repeatedly sampling the status of external devices.

  • Analogous to O

Resources:

Isn't pub-sub also doing polling?

Because there’s a program that periodically checks the queue for new messages, i.e. doing polling?

NO:

  • Polling is client-driven, where the client must initiate checks to see if new data is available.
  • Pub-Sub is typically broker-driven, where the broker pushes new data to the subscriber without the need for the subscriber to poll
    • In ROS2, the broker in DDS. It handles message routing, discovery, and communication between nodes in a decentralized manner.

So why would you ever use programmed IO / Polling?

Because it’s predictable. Interrupt-driven also introduces overhead of context switching.