"Bruno Causse" <PasDeSpam@[EMAIL PROTECTED]
> wrote in message
news:1io5eh9.bb6e4j1dw9gzaN%PasDeSpam@[EMAIL PROTECTED]
> hi all
>
> the key word "volatile" have a sence on dual processor?
>
> (not dual core, real dual processor ex : 2*xeon)
In what sense are you referring to? Sometimes you need volatile for
"certain" things in multi-threaded applications; for instance, the
following
loop:
static atomicword g_running = 1;
while (g_running) {
}
might never terminate if `g_running' was not declared as volatile...
Now, whether or not volatile has anything to do with memory visibility is
totally implementation defined. Example: A Microsoft compiler for Itanic
gives volatile "special" meaning. Namely, all stores to a volatile
variable
have preceding (#LoadStore | #StoreStore) membar, and all loads from them
have subsequent (#LoadStore | #LoadLoad) membar. This gives a
store-release,
load-acquire relation****p between loads and stores. But, I don't think
that
MSVC for PowerPC gives any special meaning to volatile; I am not sure. I
would need to RTFM.
Volatile on say, SUN's C compiler, has nothing to do with volatile on,
AFAICT, any arch it sup****ts. You need to read your compilers
do***entation
VERY, VERY carefully regarding how it treats volatile in a multi-threaded
environment!
:^o


|