Ruling out arbitrary cost copy construction?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Nov 4 13:22:27 PDT 2010


On 11/4/10 3:09 PM, Steven Schveighoffer wrote:
> On Thu, 04 Nov 2010 15:55:07 -0400, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> On 11/4/10 2:45 PM, Steven Schveighoffer wrote:
>>> On Thu, 04 Nov 2010 14:38:59 -0400, Andrei Alexandrescu
>>> <SeeWebsiteForEmail at erdani.org> wrote:
>>>> I think this can be made to work and has good properties, although a
>>>> fair amount of details need to be figured out. Please share any
>>>> thoughts you may have.
>>>
>>> What if a thread no longer exists? Would there be a way to mark such
>>> dtors that need this feature?
>>
>> Probably a thread that dies (by crashing) will never call its
>> destructors.
>
> It is quite possible that a thread exits while there are active,
> non-GC'd objects owned by it in the heap. There's no way to determine
> this when the thread exits without running a GC collection, which is
> unacceptable.

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.

[snip]
> I just was saying that I prefer solutions where we don't bend the entire
> language to cater to reference counting, if we can help it. I'd rather
> bend the reference counting implementation to fit the language.
> Something in the middle might be good too.

Absolutely.


Andrei


More information about the Digitalmars-d mailing list