Quoting r. Fabian Tillier <[EMAIL PROTECTED]>: > Subject: Re: [PATCH] opensm: make cl_atomic functions atomic > > On 3/2/06, Sasha Khapyorsky <[EMAIL PROTECTED]> wrote: > > Hello, > > > > complib's cl_atomic_() functions are not atomic in current implementation, > > they use static per function locks so race is possible between different > > functions (for example between _inc() and _dec()). Such races are pretty > > reproducible in practice - for example it is used to inc/decrement mad > > counters in opensm. > > Why aren't we using atomic operations here? Does Linux not support > atomic increment/decrement in user-mode? > > - Fab
You don't actually need operating-system support for user-mode atomics. But there is no way that I know of to do atomic operations portably across all architectures that Linux supports. So I guess complib chose the easy way out and just implemented them with a lock which is portable. -- Michael S. Tsirkin Staff Engineer, Mellanox Technologies _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
