Re:A collection of lock-free data structures written in stan...
by tialaramex on Wednesday May 10, 2023 @11:07AM
(#35888458)
If you must make progress locally (not just globally) the guarantee you need is wait freedom which is even stronger than lock freedom.
(All wait free algorithms are lock free because necessarily if every thread is guaranteed to eventually make progress then overall progress is definitely made)
Generally lock-free is better for these situations as odds are when you hold a lock at least some CPU cycles are used for something that isn't directly modifying the data that needs the lock - those cycles the other CPU can touch it when lock-free. (note that when using a lock there is a trade-off, often it is better to hold the lock for longer than needed instead of dropping, doing a couple operations and then locking again)