Posted Dec 6, 2007 5:00 UTC (Thu) by cventers (subscriber, #31465)
Parent article: Memory access and alignment
One place where alignment does matter on x86 is in SMP. As noted by the
glibc documentation, aligned word-sized reads and writes are atomic on all
known POSIX platforms. If you respect memory visibility issues, there are
certain ways you can exploit this fact to avoid the overhead of locks. In
fact, if you notice, the kernel's atomic_t type is pretty straightforward
on most platforms - especially the simple read and store operations. The
only requirement is alignment and then it is atomic for free.