07/10/26 17:12:01
>>397
§6.7.3.6
An object that has volatile-qualified type may be modified in ways unknown to the
implementation or have other unknown side effects. Therefore any expression referring
to such an object shall be evaluated strictly according to the rules of the abstract machine,
as described in 5.1.2.3. Furthermore, at every sequence point the value last stored in the
object shall agree with that prescribed by the abstract machine, except as modified by
theunknown factors mentioned previously.114) What constitutes an access to an object that
has volatile-qualified type is implementation-defined.
確かに実装依存と書いてあるね。しかしアトミックである事を保証できないのならvolatile修飾子の意味は
無い事になってしまう。規格には保証されてなくても実際volatileをそのような目的に使うなら、CPU固有の
振る舞いを知っておく事は非常に重要なはずだ。