Re: [Linuxptp-users] clock_nanosleep on /dev/ptpX
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Richard C. <ric...@gm...> - 2014-02-19 15:08:15
|
On Wed, Feb 19, 2014 at 02:58:40PM +0000, Ledda William EXT wrote: > > I might do it one day, but so far I haven't had a really compelling reason to do so. Probably using the Linux system clock (and phc2sys) will be good enough > > most of the time. It would be interesting to find out whether that is true for your own application. > > Richard, > Think about this "simple" but very interesting problem. System time is not monotonic (assuming it is in UTC), PTP time yes (assuming it is TAI). In a real time control system you could have the need to make a "wait_until" or to execute some functions in a very well-defined time in spite of any clock adjustment made to recover some UTC leap second event. This could be a valid reason to implement these features on a PHC? Well, now that we have CLOCK_TAI in Linux, that takes of the leap second issue. I agree that it would be nice to have the PHC timers, but considering the scheduling latency on typical Linux systems (even RT), I do think using the system CLOCK_REALTIME or CLOCK_TAI will be good enough. In fact, timers built off of PHC devices which are PCIe cards will probably have *worse* latency than using system timers. I would expect that only register based SoC devices (like the gianfar) would bring any benefit at all. Thanks, Richard |