Very cool but will the threads necessarily wake up deterministically? One may wake up before another but not get cpu before it correct? (forgive me if I'm misunderstanding the code)
And correctness is the single most important part of an algorithm. We can do any problem in constant time if we don't mind our answers are not correct.