Re: Embedded software interview question collection




"Michael N. Moran" <mike@xxxxxxxxxxx> wrote in message
news:2CRNg.59500$e9.5509@xxxxxxxxxxxxxxxxxxxxxxxxx
Julian Gardner wrote:

Well ive been arguing with a company because they cant get to grips what
volatile really does and because of this the new piece of hardware they
have released witb an embedded processor does not work if the cache is
switched on!!!!

I have tried for 2 years to get them to understand but they still screw
the design up.

I now need to got through all my code and try to move every variable into
a seperate block of memory so there will be no memory corruption.

Off topic, but ... maybe it's because my brain hasn't clicked on yet,
but what has the use of volatile got to do with cache?


volatile on a variable stops a compiler from doing optimisations like
caching. This is useful if there is more than one thread using the variable
because the actual variable and a cached copy would not match.

Peter


.



Relevant Pages

  • Re: Embedded software interview question collection
    ... volatile really does and because of this the new piece of hardware they have released witb an embedded processor does not work if the cache is switched on!!!! ... I now need to got through all my code and try to move every variable into a seperate block of memory so there will be no memory corruption. ... and this could be catagorized as DMA. ...
    (comp.arch.embedded)
  • Re: Embedded software interview question collection
    ... volatile really does and because of this the new piece of hardware they ... have released witb an embedded processor does not work if the cache is ... a seperate block of memory so there will be no memory corruption. ... indicate a non-cache access, and thus "volatile" avoids the cache. ...
    (comp.arch.embedded)
  • Re: Embedded software interview question collection
    ... grips what volatile really does and because of this the new piece ... memory corruption. ... but what has the use of volatile got to do with cache? ... Say the variable is really a hardware status bit, ...
    (comp.arch.embedded)
  • Re: Embedded software interview question collection
    ... and st which is what the compiler produces for volatile ... registers then the cache comes into play and you dont see the change in the ...
    (comp.arch.embedded)
  • Re: Embedded software interview question collection
    ... volatile really does and because of this the new piece of hardware they ... have released witb an embedded processor does not work if the cache is ... And how would the compiler do this? ... On the other hand, if you only worry about different threads, you do not ...
    (comp.arch.embedded)