Phil Endecott wrote:
My experience of this was with signals, e.g. sigtimer, on Linux; a library that I was trying to use worked fine until I had a timer firing 50 times each second, which caused spurious wakeups in the futex syscall. This took a ridiculously long time to debug.
Frequent signals are one way to cause behaviors such as the one I described. Under normal circumstances, a thread that has just been woken up is very, very unlikely to be immediately suspended. But signals borrow existing threads, and if a signal happens to borrow that thread and then spends the entire time slice in the signal handler, it would be as if the thread has been suspended just after it's been woken up, which in my example manifests itself as something that is indistinguishable from a spurious wakeup. This is just a speculation on my part though. I don't know if it applies to your case.