On 07/06/15 19:08, Sebastian Lackner wrote:
Hello andrea,
good catch, its actually a bug in SystemClockAdviseThread. A patch like:
--- snip --- diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index 043299b..ac41a49 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -127,6 +127,7 @@ static DWORD WINAPI SystemClockAdviseThread(LPVOID lpParam) { it = nextit; } if (NULL != it) timeOut = (DWORD) ((it->rtBaseTime + it->rtIntervalTime) - curTime) / (REFERENCE_TIME)10000;
else timeOut = INFINITE;
/** Now Periodics Advice: semi sorted list (sort cannot be used) */ for (it = This->pPeriodicAdvise; NULL != it; it = it->next) {
--- snip ---
Seems to be sufficient to fix it. I will review the code for other errors one more time, and then submit the patch.
Regarding your second question, the best timer (when using for events) is CreateWaitableTimer in my opinion. All other timers need separate threads, and need an additional wineserver call for event handling.
Regards, Sebastian
Hi,
I just wanted to check with you, if you have an idea why this patch works well for long-ish periods (>3 ms), while for 1 or 2 ms (according to the pc/situation) produces actual waits that can be much longer than requested.
on a machine I got 8ms average realised vs 1ms period requested.
thanks