Question
When is a volatile qualifier is required to be used?

Answers

In certain cases, you don't want the compiler to produce optimizations. When dealing with variables that are accessible both from an interrupt servicing routine (ISR) and by the regular code, the compiler should not make any assumptions about the value of a variable from one line of code to the next. Similarly, in a multiprocessing environment, there may be other processors that have access to shared memory variables, thereby making changes to them without warning. In such cases that involve memory mapped hardware devices, you need the volatile qualifier. Volatile qualifier prevents any optimizations done on the names they qualify, making the program possible to be used in such environments.   Your Comment






Search
Can you Answer!!
  • Q Under my compiler...
  • Q Protein requirement for a pregnant woman per day is?
  • Q What are your classroom rules? How do you make students familiar with the rules?
  • Q In which year, it was decided that the next edition of AACR would be better to publish under the new title ‘Resource Description and Access ‘?
  • Q Who was the Mughal emperor at the time of Ahmed Shah Abdali’s invasion of India?
  • Q They will ask to write one c program ?
  • Q How many justices are on the Supreme Court?
  • Q What mixed drink takes its name from the Spanish for 'bleeding'?
  • Q What is free fall acceleration?
  • Q What is the cause of pressure drop in a centrifugal
  • Q What does the %dual-5-nbrchange: ip-eigrp(0) 100: neighbor 10.254.0.3 (tunnel0) is down: holding time expired error message mean?