[project @ 2005-11-18 15:24:12 by simonmar]
authorsimonmar <unknown>
Fri, 18 Nov 2005 15:24:12 +0000 (15:24 +0000)
committersimonmar <unknown>
Fri, 18 Nov 2005 15:24:12 +0000 (15:24 +0000)
commitc5cd2343c5a86c8cb5349823a9699b30a269f3e8
tree02929661d685c1b6cc53844338f54507fdfa80ce
parent6c17d627e08e03f2b107bb9ab5d9259c7739c0d6
[project @ 2005-11-18 15:24:12 by simonmar]
Two improvements to the SMP runtime:

  - support for 'par', aka sparks.  Load balancing is very primitive
    right now, but I have seen programs that go faster using par.

  - support for backing off when a thread is found to be duplicating
    a computation currently underway in another thread.  This also
    fixes some instability in SMP, because it turned out that when
    an update frame points to an indirection, which can happen if
    a thunk is under evaluation in multiple threads, then after GC
    has shorted out the indirection the update will trash the value.
    Now we suspend the duplicate computation to the heap before this
    can happen.

Additionally:

  - stack squeezing is separate from lazy blackholing, and now only
    happens if there's a reasonable amount of squeezing to be done
    in relation to the number of words of stack that have to be moved.
    This means we won't try to shift 10Mb of stack just to save 2
    words at the bottom (it probably never happened, but still).

  - update frames are now marked when they have been visited by lazy
    blackholing, as per the SMP paper.

  - cleaned up raiseAsync() a bit.
17 files changed:
ghc/includes/Closures.h
ghc/includes/Regs.h
ghc/includes/RtsFlags.h
ghc/includes/StgMiscClosures.h
ghc/includes/Storage.h
ghc/rts/Capability.c
ghc/rts/GC.c
ghc/rts/Interpreter.c
ghc/rts/RtsFlags.c
ghc/rts/Schedule.c
ghc/rts/Schedule.h
ghc/rts/Sparks.c
ghc/rts/Sparks.h
ghc/rts/StgCRun.c
ghc/rts/StgStartup.cmm
ghc/rts/Updates.cmm
ghc/rts/Updates.h