Subj : an interesting threading-question To : comp.programming.threads From : Oliver S. Date : Wed Sep 14 2005 11:59 pm I've got a question regarding threading with C/C++: When I call a function which is out of scope for the compiler turn (f.e. in another module without global optimization or a OS-function), the compiler would have to flush all preceding writes and execute all preceding reads to non-local variables (and local variables which have been passed as references to "unknown" functions as well) to ensure that these variables can be seen by the called function and that pre- ceding reads wouldn't read data which could have been changed by the called function - and this is usually done by a combined read/write -barrier (and this is the same for following reads/writes and thus, explicit barriers are often not necessary). But this is only necessary for the executing thread to become self-consistent and not to become consistent with other threads. So theroretically this barriers could affect only the self-consitency and there could be further mechanisms which would help to become globally consistent. So soes anyone know an architecture which has two consistency-levels on account of this? .