[Issue 14221] New: Investigate the impact of calling destructors during garbage collection
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Feb 24 08:29:31 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14221
Issue ID: 14221
Summary: Investigate the impact of calling destructors during
garbage collection
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: andrei at erdani.com
Per http://forum.dlang.org/post/mchtl3$ccp$1@digitalmars.com, calling the
destructor of a struct member inside a class may do things like dereferencing a
counter. Currently destructors don't have special provisions for working from
multiple threads (e.g. File uses thread-local reference counting).
A possible approach is calling each destructor from the same thread that
created the object.
One possibility is we may deem the lapse benign, i.e. if a refcounted struct
has gotten all the way down to being collected, then a mistake in updating the
counter may at worst leave it for the next collection cycle.
--
More information about the Digitalmars-d-bugs
mailing list