[cpp-threads] High-level concurrency issues

Alexander Terekhov alexander.terekhov at gmail.com
Tue Oct 18 11:11:00 BST 2005


On 10/18/05, Herb Sutter <hsutter at microsoft.com> wrote:
[...]
> version 1. C++ learned it too -- just look at the trouble C++ vendors
> got into with refcounted implementations of basic_string, which to be
> safe ...

Correct (msync-wise) lock-free refcounted implementations of basic_string
are pretty safe (i.e. fulfill basic thread-safety guarantee). The only
real "troubles" that I know of arise among people who have a rather
strange notion of non-modifying accesses in C++. Under their misguided
theory, if a non-const member function has a const counterpart, than both
must be non-modifying... never mind that the standard explicitly "warns"
(albeit the clause is a bit defective) about invalidations caused by non-
const begin() et. al in 21.3/5.

regards,
alexander.



More information about the cpp-threads mailing list