Has anyone ever tested CDGC (Concurrent D GC)?

Robert Jacques sandford at jhu.edu
Tue Jul 19 19:28:31 PDT 2011


On Tue, 19 Jul 2011 13:28:04 -0400, Masahiro Nakagawa <repeatedly at gmail.com> wrote:
> On Wed, 20 Jul 2011 00:25:58 +0900, Robert Jacques <sandford at jhu.edu>
> wrote:
>
>> On Tue, 19 Jul 2011 10:19:09 -0400, Masahiro Nakagawa
>> <repeatedly at gmail.com> wrote:
>>
>>> On Tue, 19 Jul 2011 22:57:47 +0900, Trass3r <un at known.com> wrote:
>>>
>>>>> I am interested in Concurrent GC.
>>>>>
>>>>> But, I have a question about CDGC.
>>>>> AFAIK, other language runtimes use thread for concurrent processing.
>>>>> Why use fork()? What is the merit of fork() approach?
>>>>
>>>> I don't know.
>>>> On Windows you can't use fork anyway and we have to figure out an
>>>> alternative way.
>>>>
>>>> Maybe he explains it in his thesis, but it's only available in Spanish:
>>>> http://www.llucax.com.ar/proj/dgc/index.html
>>>
>>> Thanks for the link!
>>> But, I didn't read Spanish...
>>>
>>
>> snapshot GC
>
> I have heard this by "A Real-Time Garbage Collection for Java using
> Snapshot Algorithm".
> I understand a basic mechanism(above article uses a thread instead of
> fork()).
> Hmm... I want to see a comparison of fork() and thread.
>
>> There are two other alternative, modern GCs that I know of which fit
>> system programming languages like D. One used a kernel patch to trap
>> hardware writes efficiently, allowing one to bolt a traditional
>> concurrent GC onto a system's language. Which, while cool, isn't
>> practical until OS APIs support it out of the box. The other is
>> thread-local GCs, which according to Apple, have roughly equivalent
>> performance to existing concurrent GCs. Given shared and immutable,
>> thread-local GC's make a lot of sense for D and can be combined with
>> other concurrent options should they be/become available.
>
> I didn't know the former. Thanks for the information.
>
> Latter approach is similar to Erlang.
> Erlang provides GC per-process and I like this approach.
> Is Thread-local GC in D realistic?
> D allows global mutable state...

Well, given that D has separate types for immutable and shared data, implementing a thread-local GC in D is a while lot easier and safer than other languages like Objective-C and Java, etc for which people have already written thread-local GCs. But, unlike Erlang, D would also have to have a global shared GC in addition to the thread local GCs, in order to handle shared/immutable objects. Though how often the shared GC would actually run would be dependent on the form of concurrency you're using.


More information about the Digitalmars-d mailing list