The boost library's shared_ptr project requires a conditional increment like

inline int atomic_conditional_increment( int * pw )
{
    // if( *pw != 0 ) ++*pw;
    // return *pw;
}

I'd like to extend shared_ptr to support sparc v8+ processors using the sun 
studio compiler (v5.7 and above) using an atomic operation - the current 
implementation uses pthreads mutexes and so doesn't scale that well.

While atomic increment/decrements (using cas) are suffiently well documented 
for me to be pretty confident in my implementation I would apreciate any input 
for an atomic conditional increment.
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to