[project @ 2005-05-10 13:25:41 by simonmar]
authorsimonmar <unknown>
Tue, 10 May 2005 13:25:43 +0000 (13:25 +0000)
committersimonmar <unknown>
Tue, 10 May 2005 13:25:43 +0000 (13:25 +0000)
commitbf8219815876579f80b4e30188b982bf3e673199
tree04b13067488d0c17caa5a7e6440f03acd4d21ea5
parent24928a554aef287721af3dbe87619743412b1eed
[project @ 2005-05-10 13:25:41 by simonmar]
Two SMP-related changes:

  - New storage manager interface:

    bdescr *allocateLocal(StgRegTable *reg, nat words)

    which allocates from the current thread's nursery (being careful
    not to clash with the heap pointer).  It can do this without
    taking any locks; the lock only has to be taken if a block needs
    to be allocated.  allocateLocal() is now used instead of allocate()
    in a few PrimOps.

    This removes locks from most Integer operations, cutting down
    the overhead for SMP a bit more.

    To make this work, we have to be able to grab the current thread's
    Capability out of thin air (i.e. when called from GMP), so the
    Capability subsystem needs to keep a hash from thread IDs to
    Capabilities.

  - Small MVar optimisation: instead of taking the global
    storage-manager lock, do our own locking of MVars with a bit of
    inline assembly (x86 only for now).
13 files changed:
ghc/includes/Cmm.h
ghc/includes/Regs.h
ghc/includes/Rts.h
ghc/includes/SMP.h
ghc/includes/StgMiscClosures.h
ghc/includes/Storage.h
ghc/rts/Capability.c
ghc/rts/Capability.h
ghc/rts/GC.c
ghc/rts/Makefile
ghc/rts/PrimOps.cmm
ghc/rts/StgMiscClosures.cmm
ghc/rts/Storage.c