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

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

Re: [avr-gcc-list] generic queue library for AVR GCC?


From: E. Weddington
Subject: Re: [avr-gcc-list] generic queue library for AVR GCC?
Date: Thu, 18 Nov 2004 09:52:01 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

David Brown wrote:

The "critical" attribute doesn't hide anything more or less than a decent
set of macros or inline functions.  It makes it harder to get it wrong,
which is a good thing.  I suppose there is a danger of newbies mistakanly
using "critical" when they really mean "I want this function to run as fast
as possible".

<snip>

Obviously you want to minimise function calls (unless they are inlined) in a
critical function - in fact, you want to do as little as possible during
them.


Something to keep in mind, everybody, is that the whole concept and theory of "critical sections" is very much tied to embedded systems / system programming. Yes, they should be used with caution. This is part of the theory. If a user really wants to shoot themselves in the foot, they can. A user has to be cautious with interrupt service routines, too. And we still get newbies who are new to the concept and shoot themselves in the foot.

But, caveat emptor. I feel that as long as it's documented well enough, having a "critical" function attribute is still a Good Thing, because it does *help* in getting things right. It would help people across the entire expertise spectrum.

Now all we need is a volunteer willing to code it up and able to submit it to GCC / FSF. ;-)

Eric


reply via email to

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