Subj : Re: Lock Free -- where to start To : comp.programming.threads From : Joe Seigh Date : Wed Oct 05 2005 09:39 am Joe Seigh wrote: > Oliver S. wrote: >> >> >> Do you know the costs of this membars on current "RISC"-architectures? >> > > A hazard pointer implementation with 2 memory barriers, one for release > semantics and the other for the "store/load" barrier, on a 866 Mhz P3 > with XCHG to simulate the membars is > 81 nsec w/ membars and 8 nsec w/o membars > on a 1.2 Ghz powerpc it's > 108 nsec w/ membars and 5 nsec w/o membars > > If you got rid of the release membar, you might reduce the time a little > but probably not that much since they're pretty close together. > With only a single membar (sync) the ppc version runs about 55 nsec. But you can't get rid of the release semantics since it's all accesses you have to worry about, not just stores. That means loads as well. You can't have a load occurring from a GC managed object after it's been released and reused. That would be a bad thing. I could probably go with an isync instead of sync for the release membar if I restricted hazard pointer access to read only but it's a moot point since the membar version is only for comparision with the membar free version. It's not production code. Neither is the membar free version but that's for different reasons. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .