• simonmar's avatar
    [project @ 2005-05-10 13:25:41 by simonmar] · bf821981
    simonmar authored
    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
      - 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).