More radical ideas about gc and reference counting

via Digitalmars-d digitalmars-d at puremagic.com
Tue May 13 04:09:07 PDT 2014


On Tuesday, 13 May 2014 at 06:06:40 UTC, Rainer Schuetze wrote:
>
>
> On 12.05.2014 13:53, "Marc Schütz" <schuetzm at gmx.net>" wrote:
>>
>> I'm surprised that you didn't include:
>>
>> 3. Thread-local GC, isolated zones (restricting where 
>> references to
>> objects of a particular heap can be placed), exempting certain 
>> threads
>> from GC completely, ...
>
> This comes up from time to time, but to me it is very blurry 
> how this can work in reality.
>
> Considering how "shared" is supposed to be used to be useful 
> (do some locking, then cast away "shared") there is no 
> guarantee by the language that any object is actually thread 
> local (no references from other threads). Working with 
> immutable (e.g. strings) is shared by design.

Yes, but only a part of the data is shared. I suspect the 
majority of the data in typical programs will be thread-local. If 
you use a message passing model, you can improve that even 
further (though it requires a way to move an object to another 
thread's heap). This way, you can - in the best case - avoid the 
shared heap completely.


More information about the Digitalmars-d mailing list