If flag is declared to have type atomic<bool> or atomic_bool(C/C++) or volatile boolean(Java), and is initially false then the following snippet is data-race-free.
Tiba, Z.(2011). Targeting the most vulnerable: implementing input subsidies. In Safeguarding Food Security in Volatile Markets, A. Prakash, ed. Rome: Food and Agriculture Organization of the United Nations.
(This prohibits having array-valued properties, as when an array reference is declared volatile, only the reference, not the elements themselves, have volatile semantics.).
(However, the new semantics of volatile allow one of the commonly proposed alternatives to double-checked locking to work correctly, although the technique is still discouraged.).
不能声明为const或volatile.
It cannot be declared as const or volatile.
什么是Volatile关键字??
What is volatile keyword?
为什么不频繁使用volatile??
Why not use volatile all the time?
Volatile变量是什么??
What Are Volatile Variables?
不能声明为const或volatile.
It cannot be declared static, const or volatile.
X将不会执行任何volatile加载。
X will not perform any volatile loads.
不能将局部变量声明为volatile。
Local variables cannot be declared volatile.
无法声明为const、volatile或static。
It can't be declared const, volatile or virtual.
但记住,编译器不总是遵守volatile.
But keep in mind that compilers don't always respect volatile….
无法声明为const、volatile或static。
It cannot be declared static, const or volatile.
不懂得volatile内容将会带来灾难。
Not knowing that volatile content will bring disaster.
下面是volatile变量的几个例子:.
Here are a few examples of volatile variables.
但volatile不保证volatile变量的原子性,例如:.
Volatile variables do not guarantee atomicity, so compound functions like.
中文
Bahasa indonesia
日本語
عربى
Български
বাংলা
Český
Dansk
Deutsch
Ελληνικά
Español
Suomi
Français
עִברִית
हिंदी
Hrvatski
Magyar
Italiano
Қазақ
한국어
മലയാളം
मराठी
Bahasa malay
Nederlands
Norsk
Polski
Português
Română
Русский
Slovenský
Slovenski
Српски
Svenska
தமிழ்
తెలుగు
ไทย
Tagalog
Turkce
Українська
اردو
Tiếng việt