микрософт говорит, выравнивать обязательно:
"Once upon a time, Microsoft supported WindowsNT on processors other than x86, such as MIPS, PowerPC, and Alpha. These processors all require alignment for their interlocked instructions, so Microsoft put the requirement in their spec"
http://stackoverflow.com/questions/8818 … -alignment
If you pass an unaligned pointer to one of the Interlocked functions, the operation will still succeed, but the result won't be atomic.
Another processor may see a partially-completed update.
Вот тут имеется в виду Socket или Core ?
it happens only on multiprocessor machines
Всё равно непонятно.
lock# signal on the bus
IA-32 System programming guide, section 7.1.2.2
"The integrity of a bus lock is not affected by the alignment of the memory field. The LOCK semantics are followed for as many bus cycles as necessary to update the entire operand."
the LOCK# signal insures that the processor has exclusive use of any shared memory while the signal is asserted.
Locked instructions have a total order.
это же получается он все другие процессоры заставляет ждать при любом доступе к любой памяти по любому адресу, не?
Тогда получается, что все эти модные lock-free алгоритмы, на самом деле не такие выгодные?