Subj : Re: lockless low-overhead 'pipes' (w/semaphores) To : comp.programming.threads From : Chris Thomasson Date : Fri Apr 22 2005 08:24 am > Apart from the SSE string stuff, on IA32 (compiler reordering aside > for a moment), loads have acquire semantics, stores have release > semantics, and interlocked stuff is fully-fenced (compound acquire + > release semantics). Right. The OP should also understand that critical sections can overlap: 1: Lock( &l1 ); 2: l1_dat += 111; 3: Unlock( &l1 ); 4: Lock( &l2 ); 5: l2_dat += 222; 6: Unlock( &l2 ); Can be legitimately be reordered to: 4: Lock( &l2 ); 5: l2_dat += 222; 1: Lock( &l1 ); 2: l1_dat += 111; 6: Unlock( &l2 ); 3: Unlock( &l1 ); on IA32's... .