Hi,
I have a doudt in the polling concept.The processor polls for every N seconds to see if the device is ready and if so,the device finishes its job before X sec,what will happen in the N-X seconds???How will this latency be overcome in Real Time Embedded Systems???
Polling is usually used with soft real time constraints, as the idle tasks(which contains polling) are usually assigned a low priority otherwise it will block other tasks from working.
External Interrupts are used with asynchronous events, if you want to meet a hard real time periodic constraint then you have to rely on a timer interrupt, i.e. to program a timer (sometimes called alert) to schedule the task which implements this periodic hard real time constraint, of course this task should have a high priority so it will suspend any other task working on the kernel now.
Of course a processor is faster than IO devices, but what i am talking about is when there are multiple tasks on the same kernel, then polling (idle) tasks should be given a low priority which can cause this task to be delayed , so it is not preferred to use polling with hard real time constraints
Hi,
If what you seek is polling an external device, then external interrupts will be used instead.
Else if you are seeking a periodical check on anything, then use timer interrupts.
Short answer to your question would be: depends. If your device require attention before x time, than you will have a problem. Other way to avoid this problem is to introduce buffer so that information can be stored until polling routine gets control.