[GHC] #14810: Define MVar "This function is atomic only if there are no other producers for this MVar."

GHC ghc-devs at haskell.org
Wed Feb 14 13:29:45 UTC 2018


#14810: Define MVar "This function is atomic only if there are no other producers
for this MVar."
-------------------------------------+-------------------------------------
        Reporter:  akfp              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  libraries/base    |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Documentation     |  Unknown/Multiple
  bug                                |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 Agreed that the documentation should be improved. I was also confused
 about this some time ago.

 Producer simply means "putMVar". For example, `swapMVar` takes the current
 value and puts a new value. If another thread puts between the `swapMVar`s
 take and put, `swapMVar` blocks and other threads observe the intermediate
 step, so it won't be atomic in this case.

 Similarly consumer means "takeMVar".

 Would you like to open a pull request? I think we accept documentation
 patches via Github PRs these days.

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


More information about the ghc-tickets mailing list