volatile
C question: If I pass the address of a variable to a function that modifies it is there a guarantee that the variable will be "reloaded" after return?
I have a lot of code that used to be similar to this: int num = 15; if(callback) callback(&num);/* this function may or may not change the value of num */[详细]
2023-01-26 10:11 分类:问答Is this rule about volatile usage strict?
I\'ve seen this sentence: the general rule is, if you have variables of primitive type that must be shared among multiple threads,[详细]
2023-01-25 01:27 分类:问答Why does marking a Java variable volatile make things less synchronized?
So I just learned about the volatile keyword while writing some examples for a section that I am TAing tomorrow. I wrote a quick program to demonstrate that the ++ and -- operations are not atomic.[详细]
2023-01-23 22:47 分类:问答Volatile Variables and Happens before ordering [duplicate]
This question already has answers here: Java memory model: volatile variables and happens-before (3 answers)[详细]
2023-01-21 13:45 分类:问答Volatile classes in C++
I have a question concerning volatile keyword I can\'t seem to find an answer for. In my app I have data class that is shared as a state buffer between threads, and I need it to be updated regularly[详细]
2023-01-18 20:29 分类:问答volatile + object combination disallowed in C++?
I\'m using an embedded compiler for the TI TMS320F28335, so I\'m not sure if this is a general C++ problem (don\'t have a C++ compiler running on hand) or just my compiler. Putting the following code[详细]
2023-01-17 08:58 分类:问答Does using "pointer to volatile" prevent compiler optimizations at all times?
Here\'s the problem: your program temporarily uses some sensitive data and wants to erase it when it\'s no longer needed. Using std::fill() on itself won\'t always help - the compiler might decide tha[详细]
2023-01-17 05:07 分类:问答What is the effect of InterlockedIncrement argument declared as volatile
InterlockedIncrement and other Interlocked operations declare their arguments as volatile. Why? What is the intent开发者_如何学Pythonion and effect of this?The probable effect is very minimal. The mos[详细]
2023-01-15 21:39 分类:问答C++ volatile and operator overloading for CUDA application
I have a class A that I overload its operator=. However it is required that I need to do something like this:[详细]
2023-01-15 17:33 分类:问答What does using volatile when using a java.util.concurrent.Concurrent* containers provide?
The question came up when I saw this code: private static volatile ConcurrentHashMap<String, String> cMap = null;[详细]
2023-01-15 02:05 分类:问答