Memory management and local GC?
nise at nise.com
Mon Nov 2 16:20:28 UTC 2020
On Monday, 2 November 2020 at 14:44:08 UTC, Steven Schveighoffer
> You don't necessarily need to assign regions to threads. You
> could potentially use one region and assign different pools to
> different threads. If the GC doesn't need to scan shared data
> at all, then it's a matter of skipping the pools that aren't
> interesting to your local GC.
> As long as a pool never gets moved to another thread, you can
> avoid most locking.
Can't you spread the allocations out just like contemporary C-lib
mallocs do in order to reduce locking? This way the GC can work
just as before for the programmer. I would go for automatic
solutions as far as possible without involving the programmer or
changing the language.
More information about the Digitalmars-d