On Thu, 2009-01-08 at 11:13 -0800, Jesse Barnes wrote:
> On Thursday, January 8, 2009 2:13 am Daniel Stone wrote:
> > On Wed, Jan 07, 2009 at 11:34:42AM -0800, Eric Anholt wrote:
> > > On Wed, 2009-01-07 at 11:11 -0800, Jesse Barnes wrote:
> > > > On Wednesday, January 7, 2009 10:54 am Keith Packard wrote:
> > > > > > +libdrm_la_LIBADD = -lrt
> > > > >
> > > > > I fear you'll need autoconf-fu for this?
> > > > >
> > > > > Otherwise, it looks like a reasonable plan.
> > > >
> > > > I'm but an autoconf grasshopper.  If there's a better way of doing this
> > > > I'm open to suggestions.
> > >
> > > Paraphrased slightly from server configure.ac:
> > >
> > > AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
> > >                [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
> > >                              [AC_MSG_ERROR([Couldn't find
> > > clock_gettime])])]) AC_SUBST([CLOCK_LIB])
> >
> > You probably want to get the entire clock_gettime awesomeness, to avoid
> > the pathological worst case of rewinding the clock during a wait which
> > is destined to time out: rewind the clock 11h, 0.5sec into the wait, and
> > you'll be blocked for 11h and 0.5sec.  CLOCK_MONOTONIC ftw.
> 
> CLOCK_MONOTONIC isn't supposed to go backwards though; it can't be set (at 
> least according to spec).  So I must be missing something here...

I interpreted Daniel's words such that while the monotonic clock can't
go backwards, it may 'stand still' indefinitely. Right, Daniel?

If so, maybe it would be better to simply use gettimeofday() and time
out if the absolute delta is >= 1^6 us. That'll result in the timeout
being slightly early or late if the clock jumps, but that's probably a
better failure mode than a hang.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to