On 14 March 2012 17:18, Stephen Hemminger <[email protected]> wrote:
> > At least on linux there is is pthread_spin_lock() > Linux = pthread_spin_lock() OS X = OSSpinLock() Win32 = Win32 atomics DIY GCC = GCC atomics DIY *BSD, Solaris = BSD atomics DIY Alternative for systems with unaligned support = ticket based spin locks, fastest implementation to date. You can find all these in OpenPGM, I looked around a bit. Also have RW spinlocks. Note some implementations are not hyper-thread safe or SMP aware. I went a bit extreme and detect available cores at runtime so that I also support thread affinity - lock the process to one core and the spinlocks wont burn time. http://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/include/impl/thread.h http://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/thread.c http://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/include/impl/ticket.h -- Steve-o
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
