Re[5]: Реальный пример использования volatile
От: MaximE Великобритания  
Дата: 18.01.05 12:38
Оценка: 6 (1)
What wrote:

... Другой пример — паттерн double-checked locking, при реализации которого, кстати, может понадобиться volatile.

[q]
http://groups-beta.google.com/group/comp.lang.c++.moderated/browse_frm/thread/811a3ae4eea2d481/

The problem exists, because the C++ standard allows reordering of C++ statements,
as long as the observable behaviour stays the same — with the bad side
effect that the "observable behavior" in C++ is not multi-threading
aware and this finally leads to Scott's conclusion: "There is no
portable way to implement DCLP in C++".

[/c]

--
Maxim Yegorushkin
Posted via RSDN NNTP Server 1.9
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.