High Resolution POSIX Timers (HRT)

Current POSIX API defines two different timer facilities:

Linux provides the BSD POSIX timers with a timing resolution around 10ms, which is clearly not suitable of realtime applications. The Hight Resolution Timers (HRT) project, sponsored by MontaVista, provides microsecond resolution with lower overhead following the IEEE 1003.b POSIX API. It is distributed as a patch file which can be downloaded from Sourceforge. Current distribution works with Linux kernel 2.4.18.

This patch can provide high resolution timers with very low overhead because of two main design issues: the use of several timing and interrupt hardware sources (the old 8254, the Pentiun internal instruction TSC, and the ACPI[1] timers when available), and a clever data structure to maintain the timers.

The patch provides high resolution clocks: CLOCK_REALTIME_HR and CLOCK_MONOTONIC_HR. And the accompanying functions: clock_settime(), clock_gettime(), clock_getres(). Also the POSIX timers functions are implemented: timer_create(), timer_delete(), timer_settime(), timer_gettime() and timer_getoverrun().

Notes

[1]

Advanced Configuration and Power Interface