Advanced Embedded Systems Question: Download Advanced Embedded Systems PDF

Explain me what are the different types of customizations that is used with the “volatile” keyword?

Tweet Share WhatsApp

Answer:

Volatile keyword is used to show that the value can be changed anytime in the program. It is used for the compiler purpose and for the customization that works with the normal variables that are stored in the memory. There are three types of optimizations associated with the “volatile” keyword:

☛ "Read" optimizations: allow the variable to be read once and put it in the register. If it is done then there is no re-reading of the variable during each and every time the program is compiled. The value can be used from the cache that is present in the register.

☛ "Write" optimizations: allow the variable to be written such that the last write of the variable will be considered and it will be processed on. This takes the normal values that are stored in the memory.

☛ Instruction reordering: allow to reorder the instructions that are used by the compiler and if any modification are required after being written once. The registers are used to perform the task and keep everything together.

Download Advanced Embedded Systems PDF Read All 76 Advanced Embedded Systems Questions
Previous QuestionNext Question
Do you know what is Endianness of a system and how do different systems communicate with each other?What is the need for an infinite loop in embedded systems?