Re: [GHC] #4154: Deadlock in Chan module

#4154: Deadlock in Chan module -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.4.1 Component: libraries/base | Version: 6.12.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Replying to [comment:9 mitar]:
What about my proposal:
The only case where I have been using `isEmptyChan` was in my version of non-blocking `readChan`, returning Maybe. Is it possible to define instead of `isEmptyChan` some non-blocking version of `readChan` with `tryTakeMVar` and `tryPutMVar`? Out of curiosity, why not move to STM if you need these sorts of operations?
I think the proposal is fine (assuming it's possible to implement safely; I am not familiar with the implementation of `Chan`). Do you want to put together a patch? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/4154#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC