mosfet wrote:
I read an article about COW implementation and issues in multithreaded
environments.
Then I found another article about counted reference and now I don't
understand anything. For instance CString on windows use counted
reference but it seems it's different from COW.
AFAIK the only difference between reference-counting and COW is
that the latter is an extension of the former. In other words, COW
*is* reference-counted, but additionally if a non-const function is
called, it makes a deep copy of the data.
So if something uses COW, it uses reference-counting. Perhaps that's
what you read about CString? (Unless CString indeed doesn't make deep
copied if non-const functions are called...)