answersLogoWhite

0

When you are polling for data, you constantly check the variable in a loop of some sort to detect changes.

For example:

volatile int x = 10; //some other thread will change poll

while (x > 5);

This is a very simple example of polling. Another thread is suppose to change poll from 10 to something else. In the current thread the above excerpt is running, the while loop constantly "polls" the variable x and the thread will never move on from the while loop. Polling can be used for seen when monitoring sensors, IO streams, and other things.

Polling eats up CPU cycles and normally should be avoided in favor of other methods in most cases.

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

Is multi threading is possible with c plus plus?

Yes.


What is multithreading in C language?

Multi-threading is not part of the language.


What are the risks of using threading?

A)Testing and debugging difficulty B)Deadlocks C)Data races D)B and C E)A, B and C Any one?


What are the Topics under Advanced Java?

Some topics under Advanced Java are: a. Exception Handling b. Threading/Multi-Threading c. Remote Method Invocation d. Serialization e. etc


Is it possible to create threads on turbo c?

No, MS-DOS does not support multi-threading (or multi-processing either).


What about multithreading in c sharp?

Multi-threading in c sharp is a system with different tutorial. Like: interaction between threads, producer, using thread pool and using mutex objects.


How many C-C single bonds in 2-methyl-propane?

There would be 3 C-C single bonds in 2-methyl propane.


How many single bonds in CH3Cl?

There are 4 single bonds in CH3Cl: 3 C-H single bonds and 1 C-Cl single bond.


What is the mean of switch in c language?

switch is a mechanism provided in the C language through which we can select one among various constant option based on value of a single event.


How many numbers can be made from four digits when two are the same?

I assume you mean how many 4-digit numbers can be made from a set such as {A,A, B, C} where A, B and C are single digits. There are 12 such numbers.


What may happen if you accidentally select the 10 volt d c range on an analog meter when testing a single phase supply?

If by single phase, you mean 120/240 AC; it could blowup in your hand!


Who is considered the founder of modern public opinion polling?

A. Henry Kissinger B. Thomas Dewey C. George Gallup D. Harry Truman