in simple terms, any operation, in terms assembly instructions, which can be executed in ONE instruction, is &quot;atomic&quot;, because, just like an atom, it cannot be broken up into parts.   any instructions that is longer than one, for eg, TWO instruction, is NOT atomic, because in BETWEEN the first and 2nd instruction, something like an interrupt can come in, and affect the values of the operand when it is passed from instruction one to second instruction.  To save me from reiteration:<div>
<br></div><div><a href="http://www.ibm.com/developerworks/library/pa-dalign/">http://www.ibm.com/developerworks/library/pa-dalign/</a> (search for &quot;atomicity&quot;).<br><div><br></div><div><a href="http://stackoverflow.com/questions/381244/purpose-of-memory-alignment">http://stackoverflow.com/questions/381244/purpose-of-memory-alignment</a></div>
<div><br></div><div><a href="http://lwn.net/Articles/260832/">http://lwn.net/Articles/260832/</a></div><div><br></div><div><a href="http://www.songho.ca/misc/alignment/dataalign.html">http://www.songho.ca/misc/alignment/dataalign.html</a></div>
<div><br></div><div><a href="http://www.cis.upenn.edu/~palsetia/cit595s08/Lectures08/alignmentOrdering.pdf">http://www.cis.upenn.edu/~palsetia/cit595s08/Lectures08/alignmentOrdering.pdf</a><br><div><br></div><div><div>Essentially, atomicity and non-alignment become problematic when u tried to to read using non-byte addressing mode with non-aligned address.</div>
<div><br><div class="gmail_quote">On Sun, Feb 24, 2013 at 5:42 PM, Shraddha Kamat <span dir="ltr">&lt;<a href="mailto:sh2008ka@gmail.com" target="_blank">sh2008ka@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
what is the relation between atomic operations and memory alignment ?<br>
<br>
I read from UTLK that &quot;an unaligned memory access is not atomic&quot;<br>
<br>
please explain me , I am not able to get the relationship between<br>
memory alignment and atomicity of the operation.<br>
<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh
</div></div></div></div>