Just below. What you wrote:
"It is always a barrier because, at the lowest level, anything that sleeps
is defined to always be a barrier".
I didn't quite understand what you said here, so I'll tell what I think:
* foo() is a compiler barrier if the definition of foo() is invisible to
the compiler at a callsite.
* foo() is also a compiler barrier if the definition of foo() includes
a barrier, and it is inlined at the callsite.
If the above is wrong, or if there's something else at play as well,
do let me know.
Curiously, that's the second time you've said "sleeping is defined to
be a (compiler) barrier". How does the compiler even know if foo() is
a function that "sleeps"? Do compilers have some notion of "sleeping"
to ensure they automatically assume a compiler barrier whenever such
a function is called? Or are you saying that the compiler can see the
barrier() inside said function ... nopes, you're saying quite the
opposite below.
I think I do, why not? Would appreciate if you could elaborate on this.
Satyam
-