[Haskell-cafe] threadDelay correctness

Roman Cheplyaka roma at ro-che.info
Fri Jun 11 04:08:11 EDT 2010


* David Powell <david at drp.id.au> [2010-06-11 16:09:55+1000]
> This is a slightly different issue, but isn't there a potential problem with
> threadDelay?  I noticed that internally threadDelay uses gettimeofday() as
> the absolute time source (on linux at least).   Isn't there potential
> problem with this since wall-clock time isn't guaranteed to be monotonic
> increasing?  On linux, I'd have thought the "right" thing to do would be to
> use clock_gettime(CLOCK_MONOTONIC) although that is probably not very
> portable.

Good point -- I remember xmobar hanging after adjusting clock. Seems
like this is the cause.

-- 
Roman I. Cheplyaka :: http://ro-che.info/
"Don't let school get in the way of your education." - Mark Twain


More information about the Haskell-Cafe mailing list