[GHC] #15555: Finish separating the stable name and stable pointer tables

GHC ghc-devs at haskell.org
Wed Aug 22 03:45:40 UTC 2018


#15555: Finish separating the stable name and stable pointer tables
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Runtime System    |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by dfeuer:

Old description:

> The stable name table and stable pointer table are both implemented in
> `rts/Stable.c`, with their code interleaved. As far as I can tell, they
> basically don't share ''anything''—or at least anything that they
> actually ''should''. They ''do'' share a mutex, which smells like a
> terrible idea. Doesn't that just introduce contention between
> `StableName` and `StablePtr` operations in different threads? They also
> share an initialization function, `initStableTables`, that appears to
> allocate both a stable name table and a stable pointer table as soon as
> either of them is needed. Unless I'm missing something, there's no point
> whatsoever in doing that. So I think we should actually divide `Stable.c`
> into `StableName.c` and `StablePtr.c` and give each its own mutex.

New description:

 The stable name table and stable pointer table are both implemented in
 `rts/Stable.c`, with their code interleaved. Presumably this is for
 historical reasons; they were once one table, and they were split for
 performance reasons (see #7674).

 As far as I can tell, they basically don't share ''anything''—or at least
 anything that they actually ''should''. They ''do'' share a mutex, which
 smells like a terrible idea. Doesn't that just introduce contention
 between `StableName` and `StablePtr` operations in different threads? They
 also share an initialization function, `initStableTables`, that appears to
 allocate both a stable name table and a stable pointer table as soon as
 either of them is needed. Unless I'm missing something, there's no point
 whatsoever in doing that. So I think we should actually divide `Stable.c`
 into `StableName.c` and `StablePtr.c` and give each its own mutex.

--

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


More information about the ghc-tickets mailing list