[GHC] #7719: System.Timeout.timeout may leak <<timeout>> exceptions

GHC cvs-ghc at haskell.org
Fri Mar 8 10:05:27 CET 2013


#7719: System.Timeout.timeout may leak <<timeout>> exceptions
-------------------------+--------------------------------------------------
Reporter:  int-e         |          Owner:                
    Type:  bug           |         Status:  new           
Priority:  normal        |      Component:  libraries/base
 Version:  7.7           |       Keywords:                
      Os:  Linux         |   Architecture:  x86_64 (amd64)
 Failure:  None/Unknown  |      Blockedby:                
Blocking:                |        Related:                
-------------------------+--------------------------------------------------
Changes (by basvandijk):

 * cc: v.dijk.bas@… (added)


Comment:

 Bertram, I wonder how much you can speed it up further by doing what I did
 in my
 [http://hackage.haskell.org/trac/ghc/attachment/ticket/4963/faster_timeout.dpatch
 faster_timeout darcs patch]. Namely:

  * Giving the !TimeoutCallback access to the !TimeoutKey:

 {{{
 -type TimeoutCallback = IO ()
 +type TimeoutCallback = TimeoutKey -> IO ()
 }}}

  * Changing (or adding a new) Timeout exception type which uses the
 !TimeoutKey for identification:

 {{{newtype Timeout = Timeout TimeoutKey deriving Eq}}}

  * Use this exception instead of the existing so we can get rid of:

 {{{ex  <- fmap Timeout newUnique}}}

 which should hopefully give some speedup.

 (I could benchmark it this weekend if you can provide me the patched
 libraries to get criterion to build.)

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



More information about the ghc-tickets mailing list