3 ms·
I reach for lockless not when I fear contention, but when I have unbounded lock time. There could be no contention 98% of the time, and 500ms max wait another 1
by beagle3 6y ago
I reach for lockless not when I fear contention, but when I have unbounded lock time. There could be no contention 98% of the time, and 500ms max wait another 1% of the time - I would happily use locks. But if the last 1% is unbounded (depends on hard disk, network, user input, etc.) - that's when I try to redesign it to have essentially bounded wait time, or reach for a lockless implementation.