Date: Tue, 15 Dec 2009 16:00:08 +0100 From: Richard Cochran Message-ID: <20091215150008.GA10925@domain.hid> References: <4B1663B9.8030306@domain.hid> <4B166A5B.6030400@domain.hid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B166A5B.6030400@domain.hid> Subject: Re: [Xenomai-core] Realtime gettimeofday() List-Id: Xenomai life and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai@xenomai.org On Wed, Dec 02, 2009 at 02:23:39PM +0100, Gilles Chanteperdrix wrote: > This issue has been discussed several times, but never a lot. We have a > simple solution: starting with 2.4 (if I remember correctly) xenomai > provides clock_settime, so you can simply rely on clock_gettime, and > call clock_settime from time to time to resync the Xenomai clock with > Linux NTP-enhanced clock. This is not pretty, you get a drift increasing > over time, then suddenly been reset. But I guess this has been enough > for current users, until now. You control the maximum drift by how often > you call clock_settime. Well, it looks like I will need to use this method, too, until the "real" solution comes along. But that leaves me with more questions: 1. My program is written using the native skin, and I need to time stamp some data while in primary mode. Can I safely call the posix skin's clock_gettime() function from my native thread? 2. I will need a non-critical thread to go the gettimeofday() - clock_settime() adjustment hack once in a while. Can I safely start a both a posix skin thread and a native thread from the same main program? Thanks, Richard