Destruction in D

bitwise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 30 13:07:08 PDT 2015


After reading GC page in the reference, it seems that class 
destructors are called on a separate thread, in parallel to the 
main thread. Is this correct?

What about structs? Are the destructors called when they go out 
of scope in a C++ RAII fashion, or do they happen on a separate 
thread too?

I'm asking because one of the advantages listed for using a GC 
was something about not having to set up a special stack frame 
for destructors. I don't fully understand that point, but it 
seems like it would be incorrect if D structs destructed at end 
of scope.


More information about the Digitalmars-d-learn mailing list