Subj : membar's for double-linked list /w lock-free reads... To : comp.programming.threads From : Chris Thomasson Date : Mon May 02 2005 08:22 pm I have implemented some basic list operations that can be used with lock-free reads, but I am not "totally" sure which membars are required. I believe all that I need is a store barrier and classic release semantics. Something like this: // push into double list 1. allocate new_node and initialize it. 2. lock list mutex. 3. read list back pointer /w dependant load into lback. 4. point new_node->prev to lback. 5. Make new_node visible by pointing lback->next to new_node /w release barrier. 6. point the list back pointer to new_node /w release barrier. 7. unlock list mutex. I was wondering if that was sufficient. As you can see, step 5 makes new_node visible to readers. It seems that the release barrier in step 5 should ensure that new_node is fully visible before a reader can access it with a dependant load barrier. Any thoughts? Here is the actual code in question: http://appcore.home.comcast.net/appcore/include/ac_dlist_h.html ( all the memory barriers functions are prefixed with ac_mb_ and are located in about the middle of the file ) Thank you for your time. .