Well, let me put it this way...
Here is your nice elegant little algorithm:
Here is your nice elegant little algorithm equipped to survive within
the Linux kernel:
Any questions? ;-)
Surely this is a sign of the incoming apocalypse?
Stuff like this is dangerous to everyone.