hn • r/hackernews
Comment on: Safe Lock-free Primitives with iceoryx2's ByteAtomic
Not true.If a writer writes continuously the shared data, it is impossible for the other thread to make the copy that must be edited.If the copy succeeds, then you are right that an updated version could be substituted to the original using an atomic operation on pointers.But there is no way to guarantee that the first copy succeeds.Of course, in practice RCU is used very frequently, because all the other threads are well behaved and access the shared data for a minimum time, so the copy will succeed in most cases.But absolute guarantees are impossible inside an algorithm expressible in an abs