Subj : Re: atomic operations api added to AppCore... To : comp.programming.threads From : SenderX Date : Sun Feb 27 2005 01:12 am > Actually, there could be ABA, but it wouldn't be a problem: if a node > gets enqued and dequed between the two times I look at it, it will > always have been valid anyway, as the associated memory is never freed.. However, If aba does hit I believe it could corrupt the integrity of the data-structure itself: ANCHOR.A->B->C // initial freelist state thread a --------- 1. lf = ANCHOR.front; 2. ln = lf->next; 3. cas( &ANCHOR.front, lf, ln ) thread b -------- 1. pops A 2. pushes D 3. pushes A Think if the execution sequence goes something like this: a1: ( A->B->C ) lf = A a2: ( A->B->C ) ln = B b1: ( B->C ) this puts a2 in jeopardy b2: ( D->B->C ) b3: ( A->D->B->C ) this puts a3 in jeopardy a3: ( B->C ) corrupted... oh sh^%it! a3 corrupts the list because its cas was successful, when it should have clearly failed. I haven't looked at your code in detail so I don't know if you can suffer from this race-condition. .