I briefly mentioned the issues with multithreaded GUIs in Windows a while ago, in this post: http://www.asmcommunity.net/board/index.php?topic=29617.msg215760#msg215760

I wanted to do a more in-depth article on it, with some example code. I finally finished that yesterday: http://scalibq.wordpress.com/2012/03/27/the-story-of-microsleep/
Perhaps the usleep() function, or even the multithreaded GUI stuff in general is of use to any of you.
Posted on 2012-03-27 05:26:09 by Scali
Nice solution there with the SwitchToThread() function.

There is also an interesting discussion about timings in this old thread on sysinternals:

It got a nice summarize with in-depth info about different timing methods and timeslices, as well as pretty good references. Might be of value to know about it
Posted on 2012-03-27 15:41:56 by Azura
Yea, thanks... There was some helpful info there, about timer resolutions.

I've debugged some more, and I have managed to isolate the issue to the way Aero updates its display: http://scalibq.wordpress.com/2012/03/28/the-story-of-microsleep-followup/

It's not so bad to have usleep() in your code when you understand why it's there :)
And it's nice to know that your usleep() is as accurate as possible.
Posted on 2012-03-28 08:58:28 by Scali
I did a follow-up blog with some related issues: http://scalibq.wordpress.com/2012/05/25/the-story-of-multi-monitor-rendering/
Posted on 2012-05-25 10:51:45 by Scali
Is this where SleepEx goes?
Posted on 2012-05-27 03:59:47 by Homer