D is nice whats really wrong with gc??
H. S. Teoh
hsteoh at qfbox.info
Fri Dec 22 21:07:45 UTC 2023
On Fri, Dec 22, 2023 at 07:22:15PM +0000, Dmitry Ponyatov via Digitalmars-d-learn wrote:
> > It's called GC phobia, a knee-jerk reaction malady common among
> > C/C++ programmers
>
> I'd like to use D in hard realtime apps (gaming can be thought as one
> of them, but I mostly mean realtime dynamic multimedia and digital
> signal processing).
For digital signal processing, couldn't you just preallocate beforehand?
Even if we had a top-of-the-line incremental GC I wouldn't want to
allocate wantonly in my realtime code. I'd preallocate whatever I can,
and use region allocators for the rest.
> So, GC in such applications commonly supposed unacceptable. In
> contrast, I can find some PhD theses speaking about realtime GC,
> prioritized message passing and maybe RDMA-based clustering.
I'm always skeptical of general claims like this. Until you actually
profile and identify the real hotspots, it's just speculation.
> Unfortunately, I have no hope that D lang is popular enough that
> somebody in the topic can rewrite its runtime and gc to be usable in
> more or less hard RT apps.
Popularity has nothing to do with it. The primary showstopper here is
the lack of write barriers (and Walter's reluctance to change this).
If we had write barriers a lot more GC options would open up.
T
--
What is Matter, what is Mind? Never Mind, it doesn't Matter.
More information about the Digitalmars-d-learn
mailing list