In addition to my post about why it is a problem that the compiler does not know anything about threads I recommend this article about memory barriers and multi core machines.
And please help him find pi :-)