Skip to contentSkip to conversation

Question: queuing timer interrupts

DISCUSSION soohoon lee 2 participants 2 messages Jul 21, 2008 – Jul 22, 2008

lore
Share & tools
lore
#0 lore raw

Hi,
I like to ask you experts what would be a better way to solve following problem and side effects of my solution.

There is a system and sometimes it should unavoidably block interrupts for critical jobs for couple of 10ms so will lost timer ticks. But keeping the wall clock is also critical.
I thought about two solutions.
1. update wall clock when OS gets out of the critical section.
2. Add a hardware to count lost timer ticks, it's easy for this system.
So when the OS is able to process interrupts again, the hardware generates timer interrupts back to back to compensate lost ticks.

Thanks in advance,
Soohoon.

#1 lore raw
Quoted 6 lines · soohoon lee

There is a system and sometimes it should unavoidably block interrupts for critical jobs for couple of 10ms so will lost timer ticks. But keeping the wall clock is also critical.
I thought about two solutions.
1. update wall clock when OS gets out of the critical section.
2. Add a hardware to count lost timer ticks, it's easy for this system.
So when the OS is able to process interrupts again, the hardware generates timer interrupts back to back to compensate lost ticks.

noidlehz should handle this all correctly already. You could just treat your critical section like the idle loop and calling all the timer hooks around it. The only subtle issue is that the delay should not exceed the capability of the platform timer to tick without overflow.

-Andi