It's a pet peeve of mine when people confuse "undefined in the C++ standard" to mean "nobody has a frickin' clue what's going on." I'm not saying that's what's happening in this thread, just don't...
Type: Posts; User: brewbuck
It's a pet peeve of mine when people confuse "undefined in the C++ standard" to mean "nobody has a frickin' clue what's going on." I'm not saying that's what's happening in this thread, just don't...
"This that and the other thing" may be undefined from the perspective of C and C++ but that doesn't mean there's some kind of uncertainty about what happens. Let's not pretend we're idiots.
Doesn't this fix it?
if(global_ptr == 0){
mutex->Lock();
if(global_ptr == 0)
{
tmp = new Object();
writebarrier();
Don't yet Codeplug make you paranoid. There is no big debate about volatile or memory reordering, at least among people with a clue. I think Codeplug is just trying to cover all the bases.
There's...
Any mutex that works properly will use acquire/release semantics with appropriate fencing. All stores to memory, in particular storing the pointer to the object, will be performed before the lock is...