Re: clock_nanosleep and NTP drift correction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 13, 2012 at 11:20:24AM +0000, Koehrer Mathias (ETAS/ESS2) wrote:
| Hi all!
| 
| I have two x86 PCs running with the RT_PREEMPT patch (2.6.33.x).
| Both PCs run a real time application with a thread that will be executed periodically every 1ms.
| For this I use a
| clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL);
| within the application's main loop.
| The value of "ts" will be incremented after every call.
| 
| Both PCs (PC-A, PC-B) are connected via Ethernet to a third PC (PC-C) that acts as NTP time server for the other PCs (PC-A and PC-B).
| 
| My question is now:
| Does clock_nanosleep() consider a potential time drift that is corrected by NTP?
| Or: Will there be a significant drift between both PCs (PC-A, PC-B) by using this approach?

CLOCK_MONOTONIC is not affected by NTP nor any adjusts to date and time
that the admin/user may perform.

The only problem you could face would happen if the 'ts' value, third
parameter passed to clock_nanosleep, was coming from one system and being
used on both. Then, any difference between the clocks could lead to shorter
sleep times. Other than that, as far as manpages go, you seem to be safe.

Luis
-- 
[ Luis Claudio R. Goncalves                    Bass - Gospel - RT ]
[ Fingerprint: 4FDD B8C4 3C59 34BD 8BE9  2696 7203 D980 A448 C8F8 ]

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux