[GHC] #8972: Investigate adding fast compare-and-swap Int type/primops

GHC ghc-devs at haskell.org
Thu Apr 24 19:53:44 UTC 2014


#8972: Investigate adding fast compare-and-swap Int type/primops
-------------------------------------+------------------------------------
        Reporter:  tibbe             |            Owner:  tibbe
            Type:  feature request   |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.9
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:  8157, 7883
-------------------------------------+------------------------------------

Comment (by jberryman):

 Replying to [comment:7 jberryman]:
 > Replying to [comment:6 rrnewton]:
 >
 > > By the way, I started peeking at the benchmark code.  I don't have a
 good sense currently of how many cycles each of the following takes in
 practice:
 > >
 > >  * between a forkIO and the new thread waking up on another CPU.
 >
 > .......
 >

 Oops sorry! Here I meant to write that I'd sort of benchmarked this, but
 just added a better test (fork a `putMVar`, then block on `takeMVar` in
 main thread) which I measure at between 5.4 - 5.8 μs . So as long as you
 can get your contention test runs into the milliseconds range those
 effects should be completely hidden. Feel free to email me if this is
 distracting from this ticket and you want to chat further.

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


More information about the ghc-tickets mailing list