FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Dobbs M-Dev
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
April 01, 2003

Memory Consistency & .NET

(Page 3 of 10)
Apr03: Memory Consistency & .NET


(a)
// Oops - compiler could reorder 
// writes like this.
R = true;
for( int i=0; i<n; i++ )
   M[i] = ...; 

(b)
// Oops - compiler hoists loop invariant!
int t = R;
while( t==0 )   
   continue;
for( int i=0; i<n; i++ )
   ... = M[i];

Example 2: Compiler that presumes single-thread semantics could transform Example 1 in a way that breaks it. (a) Sender; (b) receiver.

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 Next Page
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK