Subj : Re: What does Memory Barriers mean ?? To : comp.programming.threads From : SenderX Date : Sat Jan 08 2005 09:38 am >> I have had some compiler reordering issues a while ago when I was testing >> and developing the RCU algorithm that my library uses. I disassembled >> some >> key stuff and found that a hazards reference was being performed before >> the >> RCU quiescent state changed to active. MSVC++ did not reorder the >> instructions, but GCC on linux did. > > I bet the error was on your side. Yes this was a problem with trying to use pure C with threads.... My RCU algorithm requires that the quiescent state change to "active" happens before "any" hazard reference can be attempted. GCC on Linux reordered the instructions so a hazard was executed before the GC was able to protect it. Kind of like a hazard pointer being set after the hazard reference was executed/accessed. You go boom after that.... ;) .