Le 24/11/2014 21:53, Georg Baum a écrit :
Richard Heck wrote:
Can you explain in language I can understand why simply /reading/ this
variable
in separate threads could cause this kind of problem? I'm very confused.
I guess the basic principle how copy-on-write works is clear? If not, see
e.g. http://en.wikipedia.org/wiki/Copy-on-write.
The problem is not the read access. This is safe. The problem is write
access and can be illustrated by the following code:
std::string s1("foo");
std::string s2(a);
std::string s3 = s1;
OK, could you know explain the same in terms of Language::babel(), which
is a const function? Between which objects is the representation shared?
It might be that understanding that is useless because the problem is
general as you say. But it might happen too that it helps us to
understand better what happens.
JMarc