[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] Re: bug #22163 (atomic not working as expected in C++)
From: |
Joerg Wunsch |
Subject: |
[avr-libc-dev] Re: bug #22163 (atomic not working as expected in C++) |
Date: |
Wed, 9 Jun 2010 20:36:01 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
As Dean Camera wrote:
> I concur - it makes sense to move the memory barrier to the
> definitions of the cli() and sei() macros,
(where it is now)
> There's no good reason why the user would want the compiler to
> re-order the assembly around cli() and sei(), as that's just asking
> for trouble.
There's a common miscomprehension: a memory barrier ensures that all
write operations are committed to memory, and memory locations will be
read again (so it's actually quite a big pessimization, as if all
variables were declared "volatile"), but there is currently *no*
method to prevent the compiler from reordering code. Something like
that is simply missing in the C language.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
- [avr-libc-dev] bug #22163 (atomic not working as expected in C++), Joerg Wunsch, 2010/06/09
- [avr-libc-dev] Re: bug #22163 (atomic not working as expected in C++), Dean Camera, 2010/06/09
- [avr-libc-dev] Re: bug #22163 (atomic not working as expected in C++), David Brown, 2010/06/09
- [avr-libc-dev] Re: bug #22163 (atomic not working as expected in C++), Dean Camera, 2010/06/09
- [avr-libc-dev] Re: bug #22163 (atomic not working as expected in C++),
Joerg Wunsch <=
- RE: [avr-libc-dev] Re: bug #22163 (atomic not working as expected inC++), Stu Bell, 2010/06/09
- Re: [avr-libc-dev] Re: bug #22163 (atomic not working as expected inC++), Joerg Wunsch, 2010/06/09
- RE: [avr-libc-dev] Re: bug #22163 (atomic not working as expectedinC++), Weddington, Eric, 2010/06/09
- Re: [avr-libc-dev] Re: bug #22163 (atomic not working as expectedinC++), Joerg Wunsch, 2010/06/09
- RE: [avr-libc-dev] Re: bug #22163 (atomic not working asexpectedinC++), Weddington, Eric, 2010/06/09
- RE: [avr-libc-dev] Re: bug #22163 (atomic not working as expectedinC++), Stu Bell, 2010/06/09
- Re: [avr-libc-dev] Re: bug #22163 (atomic not working as expected inC++), David Brown, 2010/06/09
- Re: [avr-libc-dev] Re: bug #22163 (atomic not working as expected inC++), Joerg Wunsch, 2010/06/09
- Re: [avr-libc-dev] Re: bug #22163 (atomic not working as expected inC++), David Brown, 2010/06/10
[avr-libc-dev] Re: bug #22163 (atomic not working as expected in C++), Joerg Wunsch, 2010/06/09