Message98482
| Author |
pitrou |
| Recipients |
brian.curtin, jnoller, kevinwatters, lemburg, nascheme, pitrou, rcohen, schmir |
| Date |
2010年01月28日.23:51:05 |
| SpamBayes Score |
1.0140369e-07 |
| Marked as misclassified |
No |
| Message-id |
<1264722740.3479.5.camel@localhost> |
| In-reply-to |
<4B621944.4030208@egenix.com> |
| Content |
> pthreads will default to use the real time clock. In order
> to have them use the monotonic timer, you have to setup
> a condition variable attribute: See the man-page for
> pthread_condattr_setclock().
I'll look at that, but I'm not thrilled at the propect of complicating
the code paths so much. There may be systems where CLOCK_MONOTONIC is
unavailable, others where pthread_condattr_setclock() is unsupported,
etc.
> The code won't get more complicated if you refactor the time
> querying logic into a separate function (which the compiler can then
> inline as necessary).
It does get more complicated, since there are several paths
(clock_gettime() and then a fallback on gettimeofday()).
I'm not talking about complexity in the executable but about maintenance
complexity. |
|