Howard Chu writes:
Unfortunately, at this time writing lockless algorithms means resorting to heavily machine-dependent code and we've been trying to stick to standardized e.g. POSIX APIs. It would be pretty easy to write a CPU-cache-friendly producer/consumer queue in assembly language for a few specific architectures, and maybe doable using compiler-specific intrinsics, but our portability would go out the window.
Portability just means there should be a fall-back implementation which uses the ldap_pvt_thread_*() locking functions. Or if it is made a separate library from OpenLDAP, it could use macros which default to pthread_*() but could be overridden to use ldap_pvt_thread_*().