Subj : Re: std::msync To : comp.programming.threads From : Peter Dimov Date : Sat Apr 02 2005 05:43 pm Alexander Terekhov wrote: > bool lock() throw() { > return use_count_.increment_if_not_min(); // naked > } msync::naked_competing, IIUC? Is cmpxchg on x86 a proper implementation of naked_competing, or does it need a lock prefix? And if lockless cmpxchg is fine, > void add_ref() throw() { > use_count_.increment(); // naked > } should this use cmpxchg too instead of lock inc/lock xadd? .