Introduction volatile keyword in C language

Introduction volatile keyword in C language:

(1) Meaning:

        The volatile keyword means that the alien may be unexpected changes. Its role is: When using the optimizer keyword defined variables, raw data read from memory directly, instead of reading the backup value stored in the register.

(2) Common uses:

        (A) an interrupt service routine will be accessible to the non-automatic variable.

        (B) multi-threaded applications to be shared by several task variables.

        (C) a parallel device hardware registers (eg: Status Register).

Guess you like

Origin www.cnblogs.com/xyzfjp/p/11442628.html