A thread without GC

Sean Kelly sean at invisibleduck.org
Tue Jul 9 10:48:54 PDT 2013


On Jul 8, 2013, at 7:04 AM, John Colvin <john.loughran.colvin at gmail.com> wrote:

> I would post this in d.learn, but I suspect there isn't an easy answer so it would be good to have some serious discussion here.
> 
> Is there any way to create a thread that is totally free from the garbage collector?
> 
> I.e.
> Nothing in that thread will ever be scanned by the GC.
> Therefore, when the GC "stops the world", that thread can just keep on going.
> 
> Obviously one could create a separate process, but it would be nice to have it encapsulated within a single process for optimum speed of communication and not having to mess around with pipes.
> 
> P.S. Yes I realise how careful one would have to be when using this.


There's a pull request for this that's been discussed on the Druntime list and while I'm willing to accept it so long as sufficient safeguards are in place, I still really don't understand the need for this feature.  Once you eliminate the GC support code there really isn't much left in core.thread.  What advantage is there of being able to create Thread objects that aren't managed by the GC (which I'll call juggernaut threads)?


More information about the Digitalmars-d mailing list