Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Might be due to my use of APCs rather than waiting on the object. Not bothered enough to try it myself but I guess you can try WaitForSingleObject on the timer to see if it behaves similarly...


On 2004, I tried timeBeginPeriod(1) and calling Sleep(1) 1000 times. Perplexingly it took a bit under 2 seconds.

On 1809 same took about 1.3 seconds.

I'm at loss... Windows timers have yet again managed to do really weird, unexpected things.

I really hope this mess doesn't affect device drivers, or there could be a world of hurt coming up.


I think it's due to my use of APCs like I said. Try replacing SleepEx(100, TRUE) with WaitForSingleObject(handle, INFINITE).

Edit: Never mind. Seems it might not be the APCs. Maybe some callee of Sleep(Ex) is just rounding up the wait interval to a time slice somewhere. Not sure... would need some digging.


I didn't call SleepEx, but just plain old Sleep. I don't see how APCs would have anything to do with this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: