Questions tagged [polling]

Polling, or polled operation, in computer science, 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 (I/O), and is also referred to as polled I/O or software-driven I/O. From [Wikipedia on Polling](https://en.wikipedia.org/wiki/Polling_%28computer_science%29)

Polling, or polled operation, in computer science, 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 (I/O), and is also referred to as polled I/O or software-driven I/O.

Polling is sometimes used synonymously with busy-wait polling (busy waiting). In this situation, when an I/O operation is required, the computer does nothing other than check the status of the I/O 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 I/O.

From Wikipedia on Polling

46 questions
110
votes
8 answers

Why is polling accepted in web programming?

I am currently working on a Ruby on Rails project which shows a list of images. A must-have for this project is that it shows new posts in realtime without the need of refreshing the web page. After searching for a while, I've stumbled upon some…
dennis
  • 1,169
  • 3
  • 9
  • 8
41
votes
5 answers

How is spinlock different from polling?

Is spinlock and polling the same thing? Wikipedia: a spinlock is a lock which causes a thread trying to acquire it to simply wait in a loop ("spin") while repeatedly checking if the lock is available This sounds awfully lot…
Lord Loh.
  • 1,767
  • 1
  • 14
  • 22
12
votes
3 answers

Push vs Poll when large delay (hours) is acceptable

It seems commonsense nowadays that polling is a bad practice and pushing is the way to go when developing mobile applications that require to constantly receive data from a remote server. All major mobile shops provide their version of a push…
10
votes
4 answers

Better ways than traditional polling methods

I'm currently in a AngularJS/Javascript environment. Currently the application using the polling method (i.e, to retrieve new data from server in a fixed amount of seconds). This is quite taxing and does not retrieve latest result immediately.…
Gene
  • 251
  • 1
  • 2
  • 8
7
votes
6 answers

How to create a timed-event architecture using a SQL database

The title of my question is general because I feel like this problem is of a general nature, but to set the stage I'm going to provide a specific example. We use a homegrown workflow engine that is driven by database tables. Within those tables…
Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
7
votes
4 answers

Is it true that for Observer Pattern to work, there probably is some polling mechanism underneath?

The short question is: is it true that for Observer Pattern to work, there probably is some polling mechanism underneath? (update: in a network situation) It was quite amazing that if on my Macbook Pro, I save a file Hello World.txt into the Dropbox…
nonopolarity
  • 1,827
  • 1
  • 16
  • 30
7
votes
5 answers

How do I balance 100 clients checking the same database table in a loop?

What I have This is a prototype. I have a pool of 100 clients connected to the server via websockets reporting things and awaiting for commands. The server polls the commands database table of type MEMORY in a loop using a query with WHERE…
6
votes
3 answers

Difference between watchdog timer and heartbeat signals?

As the title says what is the difference between watchdog timer and heartbeat signal ? When to use each of them.
Sahib Yar
  • 179
  • 1
  • 7
6
votes
3 answers

Pattern for checking online service availability

I'm not sure that this is entirely on-topic, but I'll try to make it so. I have an online service (API) and an Android application that uses it for all actions in the app. At the current moment, nothing is stored locally, so I have to depend on the…
Chris Cirefice
  • 2,984
  • 4
  • 17
  • 37
5
votes
4 answers

Alternatives to polling an API

Assume we have a desktop application (probably WinForms) that acts as a client to some API for an app with a messaging function. This API has endpoints that return a JSON of messages, and who sent them and where they sent them. A messaging feature…
Al2110
  • 245
  • 2
  • 8
5
votes
1 answer

Does the issue of battery life for constant polling warrant the extra logic/time to implement a solution with websockets?

I am in the process of designing a chat application with cordova for android devices. I have been researching and have come to the conclusion that there are two ways to go about this that could work. Websockets. Using websockets the client…
nullReference
  • 295
  • 5
  • 11
5
votes
2 answers

What term is used to describe running frequent batch jobs to emulate near real time

Suppose users of application A want to see the data updated by application B as frequently as possible. Unfortunately app A or app B cannot use message queues, and they cannot share a database. So app B writes a file, and a batch job periodically…
5
votes
2 answers

Design For Asynchronous User Interface

I have been working on a integration that has posed an interesting user interface conundrum that I would like suggestions for. The user interface is displayed within a third party product. The state of the interface is supplied by calls to a service…
Fenton
  • 1,039
  • 10
  • 14
3
votes
0 answers

Efficient BACnet device polling strategy

Example BACnet network: Some help is needed to solve a problem around architecting an efficient method of polling BACnet devices across multiple networks (i.e. MS/TP networks) where client software at the BACnet/IP level is performing the polling…
3
votes
1 answer

Design approach for continuous, time-aware processing of records

I'd like to ask what, in your view, would be one preferable and robust software design for implementing continuous processing of records in a time-aware manner. A problem overview of the problem to solve follows: There are records added to the…
luqo33
  • 141
  • 3
1
2 3 4