Skip to content
Snippets Groups Projects
  • Simon Marlow's avatar
    aa779e09
    Don't move Capabilities in setNumCapabilities (#8209) · aa779e09
    Simon Marlow authored
    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.
    aa779e09
    History
    Don't move Capabilities in setNumCapabilities (#8209)
    Simon Marlow authored
    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.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Proftimer.c 1.70 KiB