Embedded Systems
Wow. Prabakaran - please don't post such a nonsense.
If I would write program on my PC with "volatile" qualifier for some variable, run and after that just shutdown computer. Will that variable still keep previous value if I will turn on my PC again and rerun program. Obviously not.
qualifier "volatile" is simply instruction to compiler telling that for this particular variable do not do any optimization. That simple. Otherwise compiler could place that variable into register or make some other clever stuff therefore this variable will not have always up to date value. Thus if thread will be preempted by other one or by interrupt, that variable (memory location) could have not latest value. There are some other use for volatile but they pretty much circle around "not optimize this"
Cheers