Re: Linux 2.6.25-rc2

From: Jiri Kosina
Date: Thu Feb 28 2008 - 06:15:29 EST


On Wed, 27 Feb 2008, Andrew Morton wrote:

> Doing ++ on a u32 _is_ atomic wrt interrupts on x86 and probably lots of
> other architectures, so we're OK using unsigned there.

So you make implicit assumptions about how gcc compiles your ++? I am
afraid you can't do that, gcc is absolutely free to turn variable++;
statement to non-atomic sequence of instructions (memory->register load,
increment register, for example).

--
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/