Subj : Re: What does Memory Barriers mean ?? To : comp.programming.threads From : SenderX Date : Mon Jan 10 2005 11:39 pm > About the only thing a compiler can optimize across a call are local stack > variables that has never had their addresses taken. I wonder if this could happen... static int global = 0; 1. int *local = &global; 2. pthread_mutex_lock( ... ); 3. *local = 5; 4. pthread_mutex_unlock( ... ); Since local has never had its address taken, could step 3 possibly be moved out of the critical section? .