Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on A lock-free ring-buffer with contiguous reservations (2019). Parent comment
Lock-free here does not mean "without any form of synchronization primitive". That is impossible. Some synchronization must occur.
Instead, it is a term of art that means:
1. Thread failure can't cause other threads to get blocked. 2. Forward progress in the algorithm is guaranteed.
Basically: threads can't block each other and death of threads does not screw things up.
https://en.wikipedia.org/wiki/Non-blocking_algorithm
CPU atomics often work by blocking (they have to) but they are non-interruptible instructions and there is a fixed maximum execution time.
(So you can still guarantee forward progress if you use them).
There are no comments on this comment yet.
Lock-free here does not mean "without any form of synchronization primitive". That is impossible. Some synchronization must occur.
Instead, it is a term of art that means:
1. Thread failure can't cause other threads to get blocked. 2. Forward progress in the algorithm is guaranteed.
Basically: threads can't block each other and death of threads does not screw things up.
https://en.wikipedia.org/wiki/Non-blocking_algorithm
CPU atomics often work by blocking (they have to) but they are non-interruptible instructions and there is a fixed maximum execution time.
(So you can still guarantee forward progress if you use them).