avr-libc-dev
[Top][All Lists]
Advanced

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

RE: [avr-libc-dev] Re: bug #22163 (atomic not working as expectedinC++)


From: Weddington, Eric
Subject: RE: [avr-libc-dev] Re: bug #22163 (atomic not working as expectedinC++)
Date: Wed, 9 Jun 2010 13:32:39 -0600

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of Joerg Wunsch
> Sent: Wednesday, June 09, 2010 1:20 PM
> To: address@hidden
> Subject: Re: [avr-libc-dev] Re: bug #22163 (atomic not 
> working as expectedinC++)
> 
> As Stu Bell wrote:
> 
> Linux is not time-critical, unlike many things that run on
> microcontrollers.  Moving a couple of instructions around does not
> matter in a complex operating system.  The code where we came to
> the conclusion mentioned above was something like:
> 
> void foo(void)
> {
>    some_temp_variable = result_of_expensive_computation;
>                         /* I think it's been a division. */
>    cli();
>    something_time_cricital = some_temp_variable;
>    sei();
> }
> 

As a side note, wouldn't declaring some_temp_variable as volatile solve the 
issue above?



reply via email to

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