News for hackers. Stuff that matters.
Re:I've been writing ring buffers wrong all these years by gpderetta on Thursday December 15, 2016 @05:14AM (#13183589)
Actually it might not really be mispredicted. Slightly older Intel CPUs had a dedicated loop predictor that would exactly predict quite complicated taken/non-taken sequences. If the RB is of fixed size the edge case would be always perfectly predicted.

More recent CPUs, IIRC, do away with the dedicated loop predictor as they have a much more sophisticated general predictor, which, although won't guarantee perfect prediction on this case, it might still get close enough.

There are no comments on this comment yet.