:-). Well, whaddya know. Both read and write of a int (declared
volatile) are atomic on ia32.
> > (3) even if one gets either one or the other answer, one of them would
> > be the wrong answer, and you clearly intend the atomic_inc of the
> > counter to be done in the same atomic region as the setting to current,
> > which would be a programming hypothesis that is broken when the wrong
> > answer comes up.
[snip atomicity of read/write]
> being "a" an aligned memory location, a third thread reading "a" reads
> either 1 or -1. Going back to the (doubtfully useful) code, you still have
> to point out were it does bang ...
OK. I'll have a look later.
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/