http://mediant.livejournal.com/ ([identity profile] mediant.livejournal.com) wrote in [personal profile] yigal_s 2011-11-13 09:02 pm (UTC)

и где же в стандарте написано, что эти чтения должны как-то сериализоваться?

хм, еще раз читаем:

Accessing an object designated by a volatile lvalue (_basic.lval_),
modifying an object, calling a library I/O function, or calling a
function that does any of those operations are all side effects, which
are changes in the state of the execution environment. Evaluation of
an expression might produce side effects. At certain specified points
in the execution sequence called sequence points, all side effects of
previous evaluations shall be complete and no side effects of subse-
quent evaluations shall have taken place


если side effects are понимаешь, complete, то evaluation of an expression очевидно должно быть на основании этих самых свежих данных. есть другое мнение?

Разумеется, стандартный С++ был плохо приспособлен к мультитреду и нуждался в подобных расширениях.

настолько не приспособлен, что любое обращение к shared data должно быть завернуто в "подобное расширение". на volatile даже spinlock не напишешь...

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting