struct test {
atomic_t a;
atomic_t b;
}
CPU1:
atomic_set(a,return_value);
atomic_set(b,1234);
CPU2:
if(atomic_read(b) == 1234)
return atomic_read(a);
IIRC, the x86 CPU can reorder read ahead of write, and atomic_read(),
atomic_set() are normal read/write operations, so is this code SMP safe?
Which memory barrier calls are required for portability?
-- Manfred- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/