[GHC] #693: dynamic locking

GHC ghc-devs at haskell.org
Wed Jul 10 20:34:10 CEST 2013


#693: dynamic locking
----------------------------+----------------------------------------------
        Reporter:           |            Owner:  simonmar
  simonmar                  |           Status:  closed
            Type:  task     |        Milestone:  7.8.1
        Priority:  low      |          Version:  6.4.1
       Component:  Runtime  |         Keywords:
  System                    |     Architecture:  Unknown/Multiple
      Resolution:  fixed    |       Difficulty:  Moderate (less than a day)
Operating System:           |       Blocked By:
  Unknown/Multiple          |  Related Tickets:
 Type of failure:           |
  None/Unknown              |
       Test Case:  N/A      |
        Blocking:           |
----------------------------+----------------------------------------------

Comment (by ezyang):

 The way the C-- code is written now seems really odd.

 {{{
 @@ -1290,7 +1295,12 @@ stg_tryTakeMVarzh ( P_ mvar /* :: MVar a */ )
      W_ val, info, tso, q;

  #if defined(THREADED_RTS)
 -    ("ptr" info) = ccall lockClosure(mvar "ptr");
 +    if (CInt[n_capabilities] == 1 :: CInt) {
 +        info = GET_INFO(mvar);
 +    }
 +    else {
 +        ("ptr" info) = ccall reallyLockClosure(mvar "ptr");
 +    }
  #else
      info = GET_INFO(mvar);
  #endif

 }}}

 Why can't it just call lockClosure? Is the concern here the cost of the
 extra jump? Seems like we should make a macro for this, then.

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



More information about the ghc-tickets mailing list