An introduction to lockless algorithms
An introduction to lockless algorithms
Posted Feb 21, 2021 15:24 UTC (Sun) by Wol (subscriber, #4433)In reply to: An introduction to lockless algorithms by Wol
Parent article: An introduction to lockless algorithms
The start of the conditional should be
if (f <= 2) return 1;
Cheers,
Wol
Posted Feb 21, 2021 16:16 UTC (Sun)
by yann.morin.1998 (guest, #54333)
[Link]
Not necessarily. The generalised Fibonacci sequence starts with F(0) = 0 and F(1) = 1 [0]. So your initial condition was (not in)correct.
An introduction to lockless algorithms
> if (f <= 2) return 1;