[Issue 20219] Idle D programs keep consuming CPU in Gcx.scanBackground

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 17 14:25:41 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20219

--- Comment #3 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
(In reply to Rainer Schuetze from comment #2)
> Not sure what to do about the additional threads staying around forever,
> maybe they could terminate after some time of not running, but that adds
> considerable overhead when restarting them.

How costly is this overhead?

I think your suggestion is a good idea, and we should balance the time the
threads stay idle with the overhead of starting them. E.g.: let them shut down
if they have been idle for more than 100x-1000x the time that would be needed
to start them again.

(In reply to Rainer Schuetze from comment #2)
> When making it opt-in, only few programs would
> actually benefit from that, because people won't bother to change the
> defaults.

Not sure what you're trying to say, as this argument applies to both opt-in and
opt-out, with each being a compromise.

What I'm worried about of, if this were to become normalized, reactions like
"Why does this tiny program I just installed need so many threads? Oh right,
it's written in D, that language with that bloated runtime and garbage
collector which needs a dozen threads to work properly. What a mess, why hasn't
someone rewritten it in Rust yet!".

--


More information about the Digitalmars-d-bugs mailing list