[Dlang-internal] Concurrent No-Pause GC Option (idea)

frame frame86 at live.com
Mon Aug 22 18:00:42 UTC 2022


On Sunday, 21 August 2022 at 21:42:20 UTC, Sergey wrote:
> On Sunday, 21 August 2022 at 00:11:55 UTC, jordan4ibanez wrote:
>> I had an idea on the GC for CPUs that have more than one core. 
>> So basically all of them.
>>
>> So I learned on the Discord that the current GC runs parallel 
>> if this machine setup is detected, but it still pauses 
>> everything to make sure nothing is changed, thanks to adr.
>>
>
> Isn’t it the same as already proposed earlier 
> https://dlang.org/blog/2019/07/22/symmetry-autumn-of-code-experience-report-porting-a-fork-based-gc/

The mentioned fork variant would be near the same as the current 
GC, it tracks nothing. It suggests to scan in the forked process 
and then tell the mutator thread parent what blocks are free 
again.

I don't know why a fork is necessary. That can be done in a 
normal background thread also? And it doesn't eliminate the 
problem that data can be used in another thread after the scanner 
marked it as free.

Actually there is already a fork based implementation merged in 
the runtime as an alternative to parallel marking, but it still 
stops other threads, of course.


More information about the Dlang-internal mailing list