lkml.org 
[lkml]   [2004]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: with 2.6.7 setitimer called in sequence returns strange values on i686
On Tue, Aug 24, 2004 at 05:11:36PM +0200, Michael Kerrisk wrote:
> Hello Andrei,
>
> > Sorry if I'm taking your time away but to me it looks like I have kernel
> > problem, so I hoped to find some help in this list. I'm not subscribed
> > so please CC me on replies.
> >
> > I'm using setitimer(ITIMER_REAL...) to measure time intervals.
> > Everything was working fine untill I've installed 2.6.7 kernel.
> >
> > bash$ uname -a
> > Linux avorop 2.6.7 #5 Thu Aug 19 11:53:33 CEST 2004 i686 unknown
> >
> > Here's little piece of code that reproduces problem on my machine.
>
> There's a little problem with your code. You're not
> displaying microseconds correctly. That "10.479" below should really
> be "10.000479". I suspect that that sort of small rounding error
> (smaller than HZ) is probably acceptable, but someone else might
> have some input on this point.
>
> Cheers,
>
> Michael
>
> PS The use of pthreads in this program has no relevance to the
> behaviour you are seeing -- I removed the pthread stuff and saw
> the same results.

Yep. You are right. I just had some old testing program that I used with
2.4.21 and there I wanted to make sure that things work in pthread. So I
just reused it without removing pthread stuff.

This "small rounding error" crashes my application pretty nice. Because
my application assumes that when I call setitimer second time, then the
timer will be either the same or smaller, not bigger. And definetely no
man page mentions this sudden growth. Quite opposit, man page says that
the value is decremented.

At least now I know that it's reproduceble on other machines.

Andrei
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.059 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site