RE: volatile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2003-05-08 at 19:39, bblinn wrote:

> Is there a corresponding action on the writer's side?  If you write to a
> volatile variable, what causes the compiler to flush the register to
> memory?  Or similarly, what prevents the compiler from removing the
> write during optimization if it sees that you never read the variable.

Simply because both the reader and writer are using the same variable,
which is volatile. So the same rules apply to the writer, which never
aliases the variable in memory and thus always writes back to memory any
changes.

	Robert Love

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux