[En-Nut-Discussion] Fwd: Not fixed!!!: Re: confirmed!!! Re: NutOS 4.4.0 on ARM7: possibly bug in NutEnterCritical / NutExitCritical

Alain M. alainm at pobox.com
Wed Feb 27 21:35:07 CET 2008


Harald Kipp escreveu:
> Alain M. schrieb:
>> So I believe that there are two alternatives left:
>>
>> a) use a global variable. This will be a lot slower due to ARM's 
>> pipeline architecture.
>>
>> b) Call NutEnterCritical/NutExitCritical obsolete, create a new with a 
>> parameter for the storage variable. But *replace* *only* the few ones 
>> that do have a problem with stack, wich I believe are few.
> 
> Why not do both?

There is only one reason not to use allways the "global variable" 
approach: it is much slower, each instance is 4 memory accesses most in 
time critical parts of the code. That means that it is a fix that will:

1) slow down NutOS as a whole, speed *is* a strong point of Nut/OS

2) bring timing problems to existing apps!!!

We counted 106 instances of NutEnterCritical in 34 files, only 2 or 3 
will need that...

Alain




More information about the En-Nut-Discussion mailing list