incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Teleman <>
Subject Re: STDCXX-1056 [was: Re: STDCXX forks]
Date Wed, 05 Sep 2012 20:20:17 GMT
On Wed, Sep 5, 2012 at 2:40 PM, Liviu Nicoara <> wrote:

> I am afraid this would be unsafe, too (if I said otherwise earlier I was
> wrong). The compiler might re-arrange the protected assignments, such that
> another thread sees a partially updated object, where the flags are updated
> and the string not. I don't think we're going to get away with this here
> without either a simpler and more inefficient top-level locking, or doing
> away completely with the lazy initialization. Thoughts?

Yes -- there's the reordering stuff which is almost guaranteed to
happen on SPARC.

But then there's another aspect  -- which I probably failed to
highlight in my previous email: the per-object mutex implementation is
20% *slower* than the class-static mutex implementation.

class-static implementation:
real 2139.31
user 2406.09
sys 155.61

pe-object implementation:
real 2416.75
user 2694.64
sys 159.49


Stefan Teleman
KDE e.V.

View raw message