From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jeremy Friesner <jaf@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Xenomai 2.5.3 vs gettimeofday() --> livelock?
Date: Thu, 07 Jul 2011 06:54:18 +0200 [thread overview]
Message-ID: <4E153BFA.601@domain.hid> (raw)
In-Reply-To: <C15B4995-28DC-403B-8117-B9F8062571D4@domain.hid>
On 07/06/2011 10:38 PM, Jeremy Friesner wrote:
> My first question is: Am I right in suspecting that gettimeofday()
> can occasionally spin/livelock, when called from a Xenomai 2.5.3
> real-time thread? FWIW, it gets called from the real-time thread
> once every 333mS.
Yes, this is a known issue.
>
> And if that is the case, my second question is: Is there an
> alternative "safe" way to call gettimeofday() (or something
> equivalent) so that the real-time thread can find out the current PTP
> system time? Or do I need to re-write my code so that the real-time
> thread never calls gettimeofday()?
>
> Is there a recommended practice for using Xenomai threads in
> conjunction with PTP?
There are several ways out:
- the rtdk library provides a version of gettimeofday which switches to
secondary mode before calling the real gettimeofday. In order to use it,
you have to link your application with:
-Wl,--wrap,gettimeofday -lrtdk
- you can forcibly emit the syscall like the clocktest application does.
--
Gilles.
next prev parent reply other threads:[~2011-07-07 4:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 20:38 [Xenomai-help] Xenomai 2.5.3 vs gettimeofday() --> livelock? Jeremy Friesner
2011-07-07 4:54 ` Gilles Chanteperdrix [this message]
2011-07-07 8:01 ` Uwe Fechner
2011-07-11 11:14 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E153BFA.601@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=jaf@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.