[phobos] Fwd: Re: Ruling out arbitrary cost copy construction?

Max Samukha maxsamukha at gmail.com
Thu Nov 4 05:33:49 PDT 2010


On Wed, Nov 3, 2010 at 5:20 PM, Andrei Alexandrescu <andrei at erdani.com>wrote:

> Thanks for the hard data! This is very useful.
>
> The article about atomic reference counting is interesting but mostly
> compares eager copy with atomic reference counting (I attach one of the
> result files for convenience). We're also interested in the penalty exacted
> by atomicity of reference counting when compared with unprotected reference
> counting.


I want to know that too. I intend to do some tests later this week if I have
time.


> (The trick of returning a smart proxy is clever but C++ specific.)


If we cannot use that trick in D, then we need an alternative. Otherwise,
COW is less attractive.


> Also, if I understand things correctly, the article does not induce
> contention; it only measures uncontended operations.
>

I think we can ignore the case of contention when more than one thread are
modifying multiple instances sharing the same data. Such modifications
inevitably lead to allocation of a copy in each contending thread, and
creating the copies is a vastly more expensive operation than contended
operations on the reference counter.

Cases of contended copy-construction, assignment and destruction are more
interesting.


>
> Anyhow, the analysis of the class constructors in Qt is extremely relevant.
> Thanks again!
>

You are welcome.


> Andrei
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20101104/9043be34/attachment.html>


More information about the phobos mailing list