The volatile keyword is a type qualifier used to declare that an object can be modified in the program by something such as the operating system, the hardware, or a concurrently executing thread.
This means every time the variable is requested inside the program, each time the value is read from the source memory location(hard-drive,devices.etc). normal variables are stored in virtual memory of the processor. They are synced with source memory location only twice. Once during first read and second termination write.
This is useful when the variable is used as a control condition in multthreaded or RT applications.
This means every time the variable is requested inside the program, each time the value is read from the source memory location(hard-drive,devices.etc). normal variables are stored in virtual memory of the processor. They are synced with source memory location only twice. Once during first read and second termination write.
This is useful when the variable is used as a control condition in multthreaded or RT applications.
No comments:
Post a Comment