In C/C++, are volatile variables guaranteed to have eventually consistent semantics betwen threads?

前端 未结 6 764
猫巷女王i
猫巷女王i 2020-12-16 02:29

Is there any guarantee by any commonly followed standard (ISO C or C++, or any of the POSIX/SUS specifications) that a variable (perhaps marked volatile), not guarded by a m

6条回答
  •  执笔经年
    2020-12-16 03:15

    If I've understood correctly the relevant sections, C++0X won't guaranteed it for standalone variable or even volatile one (volatile isn't designed for that use), but will introduce atomic types for which you'll have the guarantee (see header ).

提交回复
热议问题