[cpp-threads] Prism 0.9.1, and further on the effects of races

Alexander Terekhov alexander.terekhov at gmail.com
Fri Sep 22 10:07:35 BST 2006


On 9/22/06, Herb Sutter <hsutter at microsoft.com> wrote:
> Peter wrote:
> > > Here's a different and maybe more useful way to put this question:
> > > Should line c be allowed any additional behaviors than if global_ptr
> > > pointed to a type having no virtual functions?
> >
> > I don't see why there should be any difference. The vptr is just a hidden
> > member of the object. Consider:
> [an example with an explicit program-declared member of pointer type]
>
> The key word is "hidden." The vptr is not a member of the object as the object is
> declared in the program source code, and I do think that's a material difference. In
> the other email I sent in response to Hans, I compared it to a COW string;

But COW strings (ala std::string ones) don't require release stores
for hidden data_ pointers. They only require relaxed release semantics
(affecting only preceding loads, not stores) for decrements storing
nonzeros and control dependent hoist store barrier otherwise (when
current value of refcount is 1; note that we can even spare final
stores of zeros) which is free/implied on all existing hardware. And
with real garbage collector (not ref-counting), they don't require any
barriers at all. So your analogy doesn't hold, I think.

regards,
alexander.



More information about the cpp-threads mailing list