From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Soboljew, Patrick" <Patrick.Soboljew@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Problem with gettimeofday
Date: Thu, 10 Dec 2009 11:41:42 +0100 [thread overview]
Message-ID: <4B20D066.5070904@domain.hid> (raw)
In-Reply-To: <EA8B423DB69FD24FA233008019A052AE016689FC@zue-s-15.zue.zwick.de>
Soboljew, Patrick wrote:
> Hello all,
>
> I have a problem concering the system time in xenomai 2.4.9.1 kernel
> 2.6.30. The framework I use calls gettimeofday() to get the absolute
> system time which is then passed to pthread_cond_timedwait. The problem
> is that when I add for example 1ms wait time the pthread_cond_timedwait
> waits much longer. I've checked /proc/xenomai/sched and I can see that
> the timeout is far too large. So I wrote a small test program to isolate
> the problem. I compared the results (only the seconds which is enough to
> show the problem) and there is a huge difference.
>
> On my system (Intel Core2, 1,6 GHz) the output of the test program shows
> the following output:
> Time1: 1260437136
> Time2: 1145908535
>
> The curious thing is: I have a vmware image with a xenomai kernel (same
> version). The problem cannot be reproduced here.
>
> Anybody an idea?
You should be using clock_gettime(CLOCK_REALTIME). In case you insist on
using gettimeofday, see:
http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#Timing_services.
--
Gilles
next prev parent reply other threads:[~2009-12-10 10:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-10 9:36 [Xenomai-help] Problem with gettimeofday Soboljew, Patrick
2009-12-10 10:41 ` Gilles Chanteperdrix [this message]
2009-12-10 12:34 ` Soboljew, Patrick
2009-12-10 13:35 ` 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=4B20D066.5070904@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=Patrick.Soboljew@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.