is d-runtime non-gc safe?

Martin Nowak dawg at dawgfoto.de
Mon Dec 5 10:08:43 PST 2011


On Sat, 03 Dec 2011 19:05:02 +0100, Andrej Mitrovic  
<andrej.mitrovich at gmail.com> wrote:

> +1 on interest on having this. Back when I was attempting to port VST
> to D I got asked by a Steinberg dev how I can guarantee that D plugins
> will work. But I couldn't guarantee it, if a GC collection were to run
> the plugin would freeze, the host would crash, and the host company
> would likely get the blame. A GC-less environment would be great for
> realtime plugins, I'm not sure how arrays/slices would work, but I
> guess custom Array refcounted structs could be made or something.

That's not true.
In your audio routines you must not call unbounded routines,
i.e. you'd better avoid allocations in the first place or
use a constant time allocator.
Any serious VST host will use two threads to avoid drop-outs.
One high priority for driving audio and one low priority for GUI.
Halting the GUI thread during GC allocations will not affect the audio.


More information about the Digitalmars-d mailing list