User Tools

Site Tools


realtime:documentation:technical_details:hr_timers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
realtime:documentation:technical_details:hr_timers [2023/09/20 14:35]
costa.shul highres.html
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://​docs.kernel.org/​timers/​highres.html|High resolution timers and dynamic ticks 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]]
realtime/documentation/technical_details/hr_timers.1695220546.txt.gz · Last modified: 2023/09/20 14:35 by costa.shul