[Issue 2858] D specs allow GC implementations that don't call finalizers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 19 15:36:52 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2858


fawzi at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fawzi at gmx.ch




------- Comment #2 from fawzi at gmx.ch  2009-04-19 17:36 -------
I agree that making the finalizers more deterministic is a good idea.
As discussed in the NG I see two problems:

1) the use of finalizers for any non memory related resource is dangerous and
should be avoided if possible. This because GC collections happens when the
memory is constrained, not when the resource is constrained, and so one might
unwillingly exhaust it. Thus making people use finalizers more and rely on the
GC is not necessarily a good idea.

2) There is a problem with daemon threads, threads that offer a service of
listen for events. It is not always good/easy to stop them, and you risk
strange errors. And no not using the GC in them is not a good option for them.

Fawzi


-- 



More information about the Digitalmars-d-bugs mailing list