This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
realtime:documentation:technical_details:hr_timers [2018/04/16 15:13] anna-maria Remove duplicated content and add a link instead |
realtime:documentation:technical_details:hr_timers [2023/10/01 18:30] (current) costa.shul src |
||
---|---|---|---|
Line 10: | Line 10: | ||
Note that (clock_)nanosleep functions do not suffer from this problem as the wakeup function at timer expiry is executed in the context of the high resolution timer interrupt. If an application is not using asynchronous signal handlers, it is recommended to use the clock_nanosleep() function with the TIMER_ABSTIME flag set instead of waiting for the periodic timer signal delivery. The application has to maintain the absolute expiry time for the next interval itself, but this is a lightweight operation of adding and normalizing two struct timespec values. The benefit is significantly lower maximum latencies (~50us) and less OS overhead in general. | Note that (clock_)nanosleep functions do not suffer from this problem as the wakeup function at timer expiry is executed in the context of the high resolution timer interrupt. If an application is not using asynchronous signal handlers, it is recommended to use the clock_nanosleep() function with the TIMER_ABSTIME flag set instead of waiting for the periodic timer signal delivery. The application has to maintain the absolute expiry time for the next interval itself, but this is a lightweight operation of adding and normalizing two struct timespec values. The benefit is significantly lower maximum latencies (~50us) and less OS overhead in general. | ||
- | Further information can be found in [[https://www.kernel.org/doc/Documentation/timers/highres.txt|kernel documentation: High resolution timer design notes]]. | + | Further information: |
+ | * [[https://docs.kernel.org/timers/hrtimers.html|hrtimers - subsystem for high-resolution kernel timers]] | ||
+ | * [[https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/hrtimer.h|include/linux/hrtimer.h]] | ||
+ | * [[https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/kernel/time/hrtimer.c|kernel/time/hrtimer.c]] | ||
+ | * 💾 //Historical//: [[https://docs.kernel.org/timers/highres.html|High resolution timers and dynamic ticks design notes]] |