The Story of Microsleep (2012)
scalibq.wordpress.com
scalibq.wordpress.com
What was so disconcerting is that while I had been operating on less sleep than I should have, I didn’t feel drowsy or tired before this happened. Thankfully I didn’t crash and was able to get a nap and continue my trip.
How is micro-sleep solving the problem that OP has underlined ? >The resulting behaviour appears to be that the message queues are filling up, and as a result, not only the windows themselves are becoming unresponsive, but the system as a whole is starting to respond poorly. This seems to happen even on a quadcore system with HyperThreading, which should be able to handle 8 threads simultaneously. So just having enough cores is not always the answer, apparently.
Ofcourse I'm open to even better solutions, but so far this is the best solution I know of.
I doubt that events/semaphores would work better, as they'd be implemented as spinlocks for short periods of time, in which case they wouldn't actually trigger a context switch. Once you use a long enough time to get to a context switch, it's probably going to be worse than doing the context switch explicitly, the way I do here.
All in all, it's a bug in Windows Aero, as the followup blog expained (not sure if it was ever fixed in later versions of Windows, I haven't been working with multiple display adapters/screens in situations like these in recent years): https://scalibq.wordpress.com/2012/03/28/the-story-of-micros...
Later in college sleep paralysis man those were brutal.