Re: TSC instead of ACPI: powerd doesn't work anymore (to be expected?)

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

  • Next message: Cai, Quanqing: "Re: kern/67919: Why nobody take serious to fix this bug?"
    Date: Mon, 31 Oct 2005 10:53:45 +0000 (GMT)
    To: David Xu <davidxu@freebsd.org>
    
    

    On Mon, 31 Oct 2005, David Xu wrote:

    > In thread program, we have to use clock_gettime, for example a thread
    > wants to wait for condition variable for two seconds, it has to:
    >
    > struct timespec ts;
    >
    > clock_gettime(CLOCK_REALTIME, &ts);
    > ts.tv_sec += 2;
    > pthread_cond_wait(&cond, &mtx);
    >
    > problem is who really cares time precise? how many people are really
    > handling realtime critical tasks? this is really an unpleasant side
    > effect that a simple syscall can stall cpu.

    The questions are: how good is good enough? And for what?

    The problem here is that while pthread_cond_wait() can afford to accept
    low resolution, the same clock retrieval interface is also used for things
    like scientific measurement. So it sounds like the real mistake was the
    specification for the thread API: while timespec is the New Way for
    time-related interfaces, this approach has coalesced precision time
    measurement and "how long to sleep for" time measurement. Moving to HZ
    incrementing of the clock probably exceeds the quality reduction that
    makes sense for clock_gettime(), but moving to a roughly sync'd TSC clock
    (such as the Linux approach) probably doesn't.

    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: Cai, Quanqing: "Re: kern/67919: Why nobody take serious to fix this bug?"

    Relevant Pages

    • Re: I Owe Einstein an Apology. Sorry Albert!
      ... >> The OWLS in this case is from a moving source. ... This is a TWLS measurement, but with an odd twist, as the light ... >>A clock is in the middle of the two detectors. ... go through detector A at +1.99 ticks and go through detector B ...
      (sci.physics.relativity)
    • Re: Circular motion in SR
      ... when a most straightforward measurement shows that nature ... any clock has the same rate as the sun.  It is ... The difference is that for a clock in motion, ... is not moving relative to the sun. ...
      (sci.physics.relativity)
    • Re: The true crackpots
      ... >> So you agree that in SR length contraction is not physical.....right?? ... Length is the result of a measurement. ... This is not the same as that a moving rod ... >> causes the rate of a moving clock to run slower than a stationary stay at ...
      (sci.physics.relativity)
    • Re: Twin paradox revisited ll
      ... measurement will be. ... I agree that the travelling twin will see that the earth clock ... having experienced the force of acceleration, is *not* the moving ... A more personal view is that physics is all ...
      (sci.physics.relativity)
    • Re: Circular motion in SR
      ... transitions of cesium isotope molecules, ... the only measurement of time allowed. ... c in S' as measured by a clock in S'. ...
      (sci.physics.relativity)