Shared keyword and the GC?

Sean Kelly sean at invisibleduck.org
Mon Oct 22 13:47:21 PDT 2012


On Oct 22, 2012, at 12:16 PM, Jacob Carlborg <doob at me.com> wrote:

> On 2012-10-22 19:44, Sean Kelly wrote:
> 
>> Blocks flagged as shared would be completely ignored by the thread-local GC collection.  Since shared data may never reference unshared data, that should avoid anything being collected that's still referenced.  I hadn't thought about "immutable" though, which may turn out to be a problem.
> 
> Funny thing, immutable was supposed to make it easier to do concurrency programming.

In the realm of shared data concurrency, immutable is definitely useful.  But where data is all thread-local I'm not entirely sure.  Either way though, immutable within the context of this discussion is a library optimization issue rather than anything to do with the type itself.


More information about the Digitalmars-d mailing list