4 ms·
Every datastructure is lock free. Locks are required when you have multiple writers. The article states the usefull only for certain circumstance: for single co
by Notbrainiac 3y ago
Every datastructure is lock free. Locks are required when you have multiple writers. The article states the usefull only for certain circumstance: for single consumer single producer scenarios. So yea within these assumptions you can make something work.
- jimktrains2 3y agoYou may need a lock if you have operations that are not atomic, even with a single writer, as a reader could find an inconsistency.
- ot 3y agoThis seems unnecessarily pedantic. Lock-free conventionally implies concurrent, otherwise it's meaningless.
- dnedic 3y agoEven in single producer single consumer scenarios you need locks for multithreaded/interrupt use if you're not properly using atomics and proper fences.
- elbigbad 3y ago[flagged]
- Koshkin 3y agoNote that "lock-free" is a technical term that has a very specific, precise meaning (implying that the user of the structure does not need to use locking explicitly).
- josephcsible 3y agoLock-free doesn't mean "doesn't have locks". It means "doesn't need locks to be used concurrently".