Ruling out arbitrary cost copy construction?
Michel Fortin
michel.fortin at michelf.com
Thu Nov 4 13:38:57 PDT 2010
On 2010-11-04 16:22:27 -0400, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> said:
> Oh, I see. Indeed, thread cleanup code should also go down the worklist
> and call destructors. By definition, no unshared objects should be
> visible by other threads.
Just a silly question... which thread will own immutable objects? And
how does the GC knows we've cast an object to immutable? Or what
happens if we just have one immutable member in the middle of a
thread-local struct? Immutable implicitly means shared, so you can leak
references to immutable members at will.
The same problem arise if you have a shared member as a member your
struct or class.
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d
mailing list