[GHC] #14156: Document the thread wakeup/scheduling/fairness semantics for the STM primitives

GHC ghc-devs at haskell.org
Fri Aug 25 19:25:07 UTC 2017


#14156: Document the thread wakeup/scheduling/fairness semantics for the STM
primitives
-------------------------------------+-------------------------------------
           Reporter:  harendra       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  libraries      |           Version:  8.2.1
  (other)                            |
           Keywords:  stm            |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Documentation
  Unknown/Multiple                   |  bug
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 In the TSem documentation I saw this:

 Note that TSem has no concept of fairness, and there is no guarantee that
 threads blocked in waitTSem will be unblocked in the same order; in fact
 they will all be unblocked at the same time and will fight over the TSem.
 Hence TSem is not suitable if you expect there to be a high number of
 threads contending for the resource.

 Is this true for all the STM primitives? If so can this be clarified in
 the documentation for each primitive? Or in the main STM module page and
 each primitive referring to it. This is an important aspect of the
 behavior which I believe can sometimes be very important for the user of
 the library.

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


More information about the ghc-tickets mailing list