avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] "Volatile"


From: David Brown
Subject: Re: [avr-gcc-list] "Volatile"
Date: Mon, 18 Apr 2005 15:24:50 +0200

> Jeff Epler wrote:
>
> >On Sun, Apr 17, 2005 at 03:27:37PM +0200, David Brown wrote:
> >
> >
> >>If your flag is declared as "volatile unsigned char flag", then
> >>operations such as "flag = 0" and "flag = 1" are atomic.
> >>
> >>
> >
> >But is that a requirement of the standard, or simply because
> >1-byte-wide stores are atomic on the AVR architecture?  I believe it's
> >the latter.
> >
> >
> >
> Agreed, IMHO it's the latter.
>

Indeed it is the later - but unless you are porting to a Turing machine,
char-wide (not necessarily byte-wide, for some PITA dsp chips) stores of
immediate values are going to be atomic.  Does it then matter if it is in
the standard or not, when there is no sane way to avoid these accesses being
atomic?






reply via email to

[Prev in Thread] Current Thread [Next in Thread]