Re: Memory reordering
От: Sharov Россия  
Дата: 09.04.15 09:06
Оценка:
Здравствуйте, mrTwister, Вы писали:

T>Утверждается следующее:

T>

In this example, LazyGet is always guaranteed to return “42.” However, if the _box field were not volatile, LazyGet would be allowed to return “0” for two reasons: the reads could get reordered, or the writes could get reordered.



race condition, b уже не null, но еще не 42...
Кодом людям нужно помогать!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.