Subj : Re: an interesting threading-question To : comp.programming.threads From : David Schwartz Date : Thu Sep 15 2005 07:14 pm "Oliver S." wrote in message news:4329afec$0$2113$9b4e6d93@newsread2.arcor-online.net... > I assume a "fictious" acrhitecture (maybe there's a real architecture > which works like this) that has two kinds of read/write-barriers: one > that makes the thread self-consistent, i.e. the following reads would > see what previous instructions wrote to memory (I'm aware that this is > more complicated in real because of different behaviours of acquire- > and release-barriers); and one which makes that changes to memory be- > come visible to other CPUs. A "fictious" compiler (depending on whe- > ther there are architectures with this two consistency levels) which > would insert barriers of the first kind before calls to "foreign" > functions (i.e. functions whose effects on global variables can't be > observed at compilation-time) would require some explicit mechanisms > to force the thread to become consistent with other CPUs. So relying > on implicit barriers on those architectures wouldn't help to get > globally consistent. On such an architecture, self-consistency barriers would need to be inserted before function calls if the compiler couldn't know what those functions did. Thread issues wouldn't be affected in any way. DS .