lkml.org 
[lkml]   [1999]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: deadlock avoidance?
Date
On Wed, 8 Dec 1999 20:32:50 +0100, 
dlibenzi@maticad.it (Davide Libenzi) wrote:
>CPU0 CPU1
>A = 0x1111 A = 0x2222
>
>Then A result or 0x1111 or 0x2222, no 0x1122 nor 0x2211 !
>This is in every Linux supported architecture.

But only if A is correctly aligned. If A starts at address n*8+7 then
at least one arch (i370) can generate 0x1122 for the above code. Most
variables are correctly aligned but if you are doing something nasty
like mapping shorts or ints over unaligned storage like this

char buf[16]; /* Assume starts at address n*8 */
CPU 0 CPU 1
*((__u16 *)(buf+7)) = 0x1111; *((__u16 *)(buf+7)) = 0x2222;

then the results are undefined.


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

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.078 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site