28 Dec
2006
28 Dec
'06
2:45 p.m.
On 12/28/06, Roland Schwarz
Sebastian Redl wrote:
What makes me believe it is that there will ever only be one writer.
Your code does not enforce this in any way.
Besides this it never is safe to access any shared data item from multiple threads, even if it is for reading only. The only exception is when you know for sure, that the access is atomic. The C++ standards does not give you any guarantees on this. (But work is in progess.)
If you talk about C++ standard then nothing is guaranteed at all about threading, since there isnt anything in the current standard about it. Nor about atomic access, so atomic access is too platform specific.
[snipped]
Roland
best regards, -- Felipe Magno de Almeida