Bug 14221 – Investigate the impact of calling destructors during garbage collection

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2015-02-24T16:29:31Z
Last change time
2024-12-13T18:40:40Z
Assigned to
No Owner
Creator
Andrei Alexandrescu
Moved to GitHub: dmd#18948 →

Comments

Comment #0 by andrei — 2015-02-24T16:29:31Z
Per http://forum.dlang.org/post/[email protected], 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.
Comment #1 by nick — 2015-02-24T17:31:14Z
Comment #2 by robert.schadek — 2024-12-13T18:40:40Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18948 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB