lkml.org 
[lkml]   [2005]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: question on memory barrier
Date
Am Mittwoch, 24. August 2005 20:22 schrieb linux-os (Dick Johnson):
> > sorry but I'm not sure to understand you...Do you mean that the first write
> > into reg_a pointer will be completed before the second write because they're
> > separated by a (;) ?
>
> Yes. The compiler must make sure that every effect of all previous
> code and all side-effects are complete at a "sequence-point". There
> are several sequence-points and the most obvious is a ";".

What the compiler may or may not generate is a little beside the point.
You have no guarantee that the CPU will execute these instructions in
the order given. If you need ordered writes use the appropriate barriers,
eg. wmb();
If this is PCI you also need to worry about the bridge caching. You
need to do dummy reads.

Regards
Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-24 21:35    [W:0.108 / U:1.384 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site