[commit: ghc] master: Don't move Capabilities in setNumCapabilities (#8209) (aa779e0)

git at git.haskell.org git at git.haskell.org
Wed Sep 4 12:37:48 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/aa779e092c4f4d6a6691f3a4fc4074e6359337f8/ghc

>---------------------------------------------------------------

commit aa779e092c4f4d6a6691f3a4fc4074e6359337f8
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Wed Sep 4 10:37:10 2013 +0100

    Don't move Capabilities in setNumCapabilities (#8209)
    
    We have various problems with reallocating the array of Capabilities,
    due to threads in waitForReturnCapability that are already holding a
    pointer to a Capability.
    
    Rather than add more locking to make this safer, I decided it would be
    easier to ensure that we never move the Capabilities at all.  The
    capabilities array is now an array of pointers to Capabaility.  There
    are extra indirections, but it rarely matters - we don't often access
    Capabilities via the array, normally we already have a pointer to
    one.  I ran the parallel benchmarks and didn't see any difference.


>---------------------------------------------------------------

aa779e092c4f4d6a6691f3a4fc4074e6359337f8
 rts/Capability.c      |   83 +++++++++++++++++++++++-----------------------
 rts/Capability.h      |    8 ++---
 rts/Profiling.c       |    2 +-
 rts/Proftimer.c       |    2 +-
 rts/RetainerProfile.c |    2 +-
 rts/Schedule.c        |   87 ++++++++++++++++++++-----------------------------
 rts/Stats.c           |   34 +++++++++----------
 rts/Task.c            |   28 ----------------
 rts/Task.h            |    5 ---
 rts/Threads.c         |    2 +-
 rts/sm/Compact.c      |    2 +-
 rts/sm/GC.c           |   50 +++++++++++++---------------
 rts/sm/Sanity.c       |   14 ++++----
 rts/sm/Storage.c      |   10 +++---
 14 files changed, 138 insertions(+), 191 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc aa779e092c4f4d6a6691f3a4fc4074e6359337f8




More information about the ghc-commits mailing list