Re: [PATCH] doc: volatile considered evil

Alan Cox
2007-05-09T13:28:24Z

> > When you are implementing the locking primitives on a new platform. When
> > you are implementing the I/O and atomic prmitives on a new platform. Also
> > in inline gcc assembler where "volatile" is used for subtly different
> > purposes.
>
> Is there a good reason for using volatile in atomic/locking primitives?
> AFAIKS there is not.

Depends on the platform. If you are writing a new architecture then who
knows what you will need to get the barriers right - you may want to use
volatile, you may want to use asm.