4b3 Subj : Re: YALFAm (Yet Another Lock Free Approach, maybe) To : comp.programming.threads From : Joe Seigh Date : Mon May 16 2005 10:22 am On Sun, 15 May 2005 04:04:19 -0700, Chris Thomasson <_no_damn_spam_cristom@_no_damn_comcast.net_spam> wrote: >> I have an idea about a 'mainly' lock free implementation that I'd >> appreciate comments on. >> I'm attempting to solve the same sort of problem as Joe Seigh's atomic_ptr >> (http://atomic-ptr-plus.sourceforge.net/), but in a way that will work on >> win64 and win32 (so I want to avoid assembly and reliance on instructions >> that are not present on some processors). > > You can create a single-word atomic reference counted pointer with SMR that > can outperform ( totally ia-32 specific ) atomic_ptr on x86; 'lock > cmpxchg8b' can be expensive. SMR based reference counting doesn't have to > rely on the hefty lock prefix on x86, it can use the "more" lightweight > mfence instruction... > Instructions. You need an additional membar for the release semantics if you are storing into a non null hazard pointer. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. . 0