GC via low-priority thread

Luis Marques luismarques at gmail.com
Fri Jun 23 07:28:28 PDT 2006


Hello,

I've been wondering, I've read on this newsgroup that one could use a
low-priority thread to do GC, perhaps setting watermarks of memory usage after
which that thread's priority would raise.

What I question is the following. Here http://digitalmars.com/d/memory.html says
that "All threads other than the collector thread must be halted while the
collection is in progress". So, wouldn't you still experience the halting that
makes GC problematic? Or the ideia supposed to be that more frequent GC cycles
would make each cycle faster and imperceptible? But in that case I can't really
see how the thread priority would matter much.

PS: I hope this is the right newsgroup to discuss this, I suppose my last post
should have been sent to .learn, but my first reaction was "that doesn't work as
the docs say!"

Luís Marques



More information about the Digitalmars-d mailing list