gc

Simen kjaeraas simen.kjaras at gmail.com
Sun Mar 28 08:00:42 PDT 2010


sclytrack <idiot at hotmail.com> wrote:

> gc1    thread1
>        thread2
>        thread3
>
> gc2    thread4
>        thread5
>
> when the gc1 cycles it does not block the gc2 threads. Would that be of  
> any use?
> Or possible. And only use communication like between two processes, some
> interprocess communication message passing thing.
> I mean the entire pure thing makes heavy use of the garbage collector,  
> maybe
> isolating them is a solution, just let it cycle independent from the  
> rest.
> But on the other hand you could just make two processes.

This has been discussed for D2's concurrency system, often in conjunction
with per-thread heaps. The most likely system (as far as I've understood),
is a global GC in the main thread, that takes care of shared objects, and
per-thread GCs for thread-local storage. Problems may occur when objects
are moved from one thread to another, or when created in one thread and
later cast to shared.

Granted, I am no GC expert, so everything written above should be taken a
pinch or two of salt.

-- 
Simen


More information about the Digitalmars-d-learn mailing list