The "no gc" crowd

Denis Koroskin 2korden at gmail.com
Tue Oct 8 15:31:10 PDT 2013


On Tuesday, 8 October 2013 at 20:44:56 UTC, deadalnix wrote:
> On Tuesday, 8 October 2013 at 16:22:25 UTC, Dicebot wrote:
>> On Tuesday, 8 October 2013 at 15:43:46 UTC, ponce wrote:
>>> Is there a plan to have a standard counter-attack to that 
>>> kind of overblown problems?
>>> It could be just a solid blog post or a @nogc feature.
>>
>> It is not overblown.
>
> I'm certain that most people complaining about it absolutely do 
> not have the constraint that eliminate the possibility to use a 
> GC.

One interesting detail which is rarely explored is that you can 
"disable" GC for a portion of a program without actually 
disabling entire GC.

In my current project I have a couple of threads that must never 
stop, especially not for a garbage collection. These threads 
manage their memory manually and don't rely on GC (we use 
reference counting to make sure we don't leak). The rest of the 
threads, however, make heavy use of the GC, and communicate with 
"real-time" threads using message passing.

The trick is to spawn *native* threads (i.e. not std.core.Thread 
threads) so that when stop-the-world occurs, thread_suspendAll() 
will not block the said threads (because it won't even know about 
them!).

Per-thread allocator will hopefully make things even more simple.


More information about the Digitalmars-d mailing list