[GHC] #6061: threadDelay broken on Windows

GHC cvs-ghc at haskell.org
Mon Apr 30 15:51:12 CEST 2012


#6061: threadDelay broken on Windows
---------------------------------+------------------------------------------
    Reporter:  simonmar          |       Owner:  pcapriotti      
        Type:  bug               |      Status:  new             
    Priority:  highest           |   Milestone:  7.6.1           
   Component:  Compiler          |     Version:  7.4.1           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by pcapriotti):

 I think this is due to clock skew among different CPUs when using QPC. The
 skew itself shouldn't be very large (up to 5 μs on my system), so it's not
 a concern for the purpose of `threadDelay`, but it does break the
 invariant that the actual delay time is greater or equal to the requested
 time. Maybe we could just change the test and add a few μs tolerance.

 I'm not sure why you saw `threadDelay 1000000` return immediately. I
 haven't been able to reproduce that here. Maybe the clock skew can got
 over 1 second somehow? That would mean we can't really rely on
 `QueryPerformanceCounter`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6061#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list