answersLogoWhite

0

This would technically depend on the programming language, but there is no reason for a constant to be declared volatile.

In most languages, a volatile variable is one which may be shared by multiple threads and which also may change at any time. The volatile keyword is used to tell the computer not to cache the value of the variable.

Since constants cannot change, there is no reason that multiple threads would have a problem reading from it at the same time.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is a variable plus a variable?

A variable is a named memory location for which the contents are volatile. The antonym of variable is constant.


Can a Volatile variable be static also?

Probably; I don't see anything in the standard that says you can't. However, the use of the volatile keyword is usually in embedded code, or multi-threading in which you don't want the compiler to do optimizations on the variable itself.Yes, sure.


What are similarities between an independent variable and a constant variable?

Well, they're both variables.


What is the constant and variable of 6x?

The constant is the number; the variable is the letter.


What is volatile and why are using in java?

volatile variable is mainly used in multithreading environment. so let me explain it from that context.In a multithreading environment,for a variable which is not marked as volatile will be stored in local cache memory for each thread. Meaning each thread will have a local copy of the variable and they dont know about what value this variable is having in another thread. If a variable is marked volatile, then the updations to this variable will happen in the main memory and not in local cache


Can a body have constant speed as well as variable velocity?

No, constant speed implies that the body is moving at a consistent rate, while variable velocity means the direction of motion is changing. It is not possible for a body to have both constant speed and variable velocity simultaneously.


What is the constant variable in Avogadro's law?

The question is about an oxymoronic expression. A constant cannot be a variable and a variable cannot be a constant!


What a variable that does not change in an experiment is called a constant?

Constant variable


Can an object have constant velocity and but variable speed?

No, an object cannot have constant velocity and variable speed. Velocity is a vector quantity that includes both speed and direction. If the object's velocity is constant, then its speed must also be constant.


Is a constant a number variable or the product of a number and one or more variables?

A constant is not a variable at all, and none of its factors was a variable. It is constant.


What is main difference between declaring variable and volatile variable?

In languages like C, declaring a variable "volatile" tells the compiler that it can't assume that the variable is only changed by the program code. If the variable is not declared volatile, sometimes the compiler can make certain optimizations since it can assume that it knows everything about how the variable will be used. When it is declared volatile, the variable may be changed by an external process (for example, it could be connected to an I/O device), so it must always be fetched from memory. For a better explanation, see the related links.


What is the opposite of the word constant?

The opposite of the word "constant" is "variable".