use compiler memory barrier