[GHC] #8521: Tight loop prevents other threads from running in available cores

#8521: Tight loop prevents other threads from running in available cores -------------------------------------+------------------------------------- Reporter: facundo.dominguez | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 (amd64) | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- The following program does not terminate when compiled with: {{{ghc --make -O -threaded test.hs}}} and executed on linux on an amd64 machine with 16 cores with: {{{./test}}} {{{ import Control.Concurrent import Control.Monad import System.Environment main :: IO () main = do y <- getArgs mv0 <- newEmptyMVar mv1 <- newEmptyMVar forkIO $ do takeMVar mv0 putMVar mv1 () loop (y == ["yield"]) putMVar mv0 () takeMVar mv1 >>= print loop :: Bool -> IO () loop cooperative = go where go = when cooperative yield >> go }}} Here [1] is the discussion about it so far. [1] http://www.haskell.org/pipermail/glasgow-haskell- users/2013-October/024412.html -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8521 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8521: Tight loop prevents other threads from running in available cores --------------------------------------+---------------------------------- Reporter: facundo.dominguez | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: Component: Runtime System | Version: 7.6.3 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+---------------------------------- Changes (by simonmar): * status: new => closed * resolution: => duplicate Comment: Dup of #367 If `-fno-omit-yields` does ''not'' fix the problem (with GHC 7.7+), then please re-open the ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8521#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC