News for hackers. Stuff that matters.
Re:Seqlock-Based Atomic Memory Snapshots by o11c on Saturday August 26, 2023 @12:46PM (#37274438)
Interesting, but I'm still of the opinion that it's better to just avoid k-CAS in the first place. This is usually possible with sufficient control over your memory allocation/deallocation patterns.

(Also, I really hate spinlocks, since the scheduler can totally ruin them - with a good atomic algorithm, you can guarantee that if you have to loop, it is only because somebody is is actively making progress, with no possibility of them being unscheduled).

Re:Seqlock-Based Atomic Memory Snapshots by amluto on Saturday August 26, 2023 @12:50PM (#37274489)
Where do you see k-CAS?

If, by control of allocation you mean doing something like RCU or its garbage-collected equivalent, sure, if it’s reasonable in your environment, go for it. But seqlocks and their variants produce no garbage and can be extremely efficient in appropriate contexts.

(The Linux vDSO, for example, cannot usefully participate in GC or RCU. seqlocks it is.)