I'm using spinlocks (pthread ones) with generally O(1) list element access/removal in the locked code section.
I say generally because on 99.9% of cases the code doesn't loop through the list (which might contain 1000+ elements).
The code will usually extract one only element based on a list element hint pointer and then perform a couple of if branches to modify the cited hint element; still it should be a non contiguous access to memory.
Is it a good idea to use spinlocks or should I move to mutexes?
I'm aiming at max performance, don't care about CPU (over) usage in this context.
Cheers