[GHC] #13613: Simplify fixIO

#13613: Simplify fixIO -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Core | Version: 8.0.1 Libraries | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Now that we have `noDuplicate#`, I think we can make `fixIO` much simpler, and perhaps also faster, using something like what we do for `ST`. {{{#!hs data Res a = Res (# State# RealWorld, a #) fixIO f = IO $ \s -> let Res r@(# _s', a #) = unIO (noDuplicate >> f a) s in r }}} If `f` forks an `IO` thread demanding `a`, the `noDuplicate` should ensure that the computation is not re-entered, and the thread should wait for the main computation to complete. So I believe, anyway. The comment about eager blackholing here is a bit vague and doesn't give an example. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13613 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13613: Simplify fixIO -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: task | Status: closed Priority: normal | Milestone: 8.4.1 Component: Core Libraries | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: new => closed * resolution: => fixed Comment: This turned out to be the wrong fix; instead we switched to `readMVar` with `unsafeDupableInterleaveIO`. See 239418cf94dede0f116bb859d1bb95891235eb76. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13613#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC