Poll a Process what is the right?

What is the right design to create continuous polling process?

What is the typical behavior of polling process?

One of the most question, in development of our software, is how we create polling process, for example an acquisition process.

But the first question is what is a polling process? What’s the properties and add features?

Polling is process where someone asks, waits and receives something from someone else.

Is something like this.

Properties and fundamental question is Wait Time, Msg Sent, Msg Received, how it start?, how it stop.

In QMH, or other message based framework, this process need communicate from and to other processes.

Two kind of implement is Resending Msg and Timeout.

ReEnque Message after acquisition 

Issue : Other messages may not be executed, especially if sent by other slower processes.

Benefit : Not require timeout or contiuous poll

Solution: Enqueue on the opposite side for priority messages, and before turning on again, look for other messages in the queue and if they are different from the polling message.

As a sample GetStatus retrieve msg’s from queue and check if Acquire msg are present, if not enque.


Use Timeouts 


Benefit: Timeout solves the problem, the code is then executed only if no messages have been sent.

Issue: Need some code to prevent the code from running in an uncontrolled manner, for example without first being initialised.