GC interuptable?

Jarrett Billingsley kb3ctd2 at yahoo.com
Sat Dec 16 07:29:27 PST 2006


"chrisj" <a at b.c> wrote in message news:em12um$6ut$1 at digitaldaemon.com...
>>
>> This also implies another way to have code run while the GC is running --  
>> if you create a thread without using std.thread, the GC won't know about 
>> it and won't stop it during the collection.  So it can go ahead and run 
>> while the GC is doing its thing.
>
> How hard would it be to stop such a thread buggering up the GC?

I guess just not using the GC?  I.e. always using malloc/free, or no dynamic 
memory allocations at all?  And I suppose it'd also be a good idea not to 
touch memory that was allocated by the GC either.  So what you'd have to do 
is have a non-GC section of your program handled by that thread alone, and 
it wouldn't touch anything else.  Then your main GC'ed program would be able 
to look at the data held by the non-GC segment in order to update itself.

I don't know if this is all right.  I don't really have much experience with 
multithreaded programming, let alone those with non-GC parts. 





More information about the Digitalmars-d mailing list