[PATCH_v2] use CLOCK_MONOTONIC_COARSE posix timer instead of CLOCK_MONOTONIC in Xorg

Daniel Stone daniel at fooishbar.org
Fri Aug 27 04:53:57 PDT 2010


On Fri, Aug 27, 2010 at 05:32:55PM +0800, ykzhao wrote:
> On Fri, 2010-08-27 at 10:15 +0800, Daniel Stone wrote:
> > Your patch, however, removes the check to make sure the monotonic clock
> > is working.  
> 
> No. The CLOCK_MONOTONIC check is not removed. It is realized by using:
>    >if (clock_gettime(clockid, &tp) == 0)
>    If it fails, it will then call the function of gettimeofday.
>    
>    When the CLOCK_MONOTONIC_COARSE is not supported or the resolution of
> timer is greater than 1ms, it will fall back to CLOCK_MONOTONIC. 
> 
> If you expect to do more check about CLOCK_MONOTONIC, Maybe we can add
> another patch to check it. 

I should've replied to this part as well: your patch makes it no worse
than currently, but it's still a regression compared to the suggested
patch I posted a few days ago.  With your patch, if CLOCK_MONOTONIC is
unsupported on the target, every call to GetTimeInMillis() will take two
syscalls instead of one.  The patch I posted tests each one once, and
thus only makes one syscall, assuming the clocks don't magically
transition from working to not working.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100827/a4a58656/attachment.pgp>


More information about the xorg-devel mailing list