Re: Timers and timing, was: MySQL Performance 6.0rc1

From: Robert Watson (rwatson_at_FreeBSD.org)
Date: 10/29/05

  • Next message: Poul-Henning Kamp: "Re: FreeBSD on IBM blade servers"
    Date: Sat, 29 Oct 2005 11:09:51 +0100 (BST)
    To: "M. Warner Losh" <imp@bsdimp.com>
    
    

    On Fri, 28 Oct 2005, M. Warner Losh wrote:

    > : thread libraries use clock_gettime, this becauses there is
    > : pthread_cond_timedwait and other synchronization objects
    > : like rwlock, and mutex all have a timeout version, I think
    > : pthread_cond_timedwait is mostly used in some applications,
    > : though normally, application is not looking for high accuracy.
    > : they will get benefit from the clock_gettime speed improvement.
    >
    > And unfortuantely, the argument that needs to be passed to abstime is
    > unspecified, at leas tin our man page. Also unfortuantely,
    > CLOCK_REALTIME seems to be what's required here (our man page just says
    > 'if the system time reaches the time specified in abstime'), rather than
    > CLOCK_MONOTONIC so jumps in system time can cause previously short
    > timeouts to become rather large timeouts... This is a flaw in the API.
    > :-(

    If the assumption is that these calls will behave like select() and
    poll(), then I would guess lowering the accuracy here would not be a
    problem, since it is widely understand that select() waits at timer tick
    granularity.

    Robert N M Watson
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"


  • Next message: Poul-Henning Kamp: "Re: FreeBSD on IBM blade servers"