RFC re winmm/time.c

Jeremy White jwhite at codeweavers.com
Sat Oct 9 22:39:39 CDT 2004


Hi Folks,

I ran into a problem with PowerPoint and winmm timer events,
that has led me to radically alter this file.

However, I'd appreciate a gut check from anyone more
experienced with it than I.

The fundamental problem is that Powerpoint does a
timeBeginPeriod(1), trying to set timer resolution
to 1 ms; we steadfastly discard that, and continue
generating time updates and events on a roughly
10 ms interval, this can, in rare situations,
lead to some awkward delays.

Some investigation with a test program shows that most Windows systems 
start with a default resolution of 1 ms.
This test program is attached; the 'average' reported
at the top is the default resolution.  Further, Windows seem to
steadfastly ignore any timeBeginPeriod(x)
where x > the current period.  I surveyed about 6 systems;
a mix on Win98/Win2k and Win XP.  All but one rogue
Win 2K system had a 1 ms timer interval (the rogue system
had a 10 ms interval; why, I do not know).  The MSDN
pages suggest (but don't state clearly) that this
is the expected behavior.

This behavior essentially means that on most Windows systems
the timer resolution of winmm is 1ms and can not be changed.

So, question #1:  anyone object if I fix the timer resolution at 1 ms?

Next, if I make this change, it makes the code in time.c,
which is fairly awkward imho, even less efficient.
We'll basically be scanning a loop every ms for no
particularly good reason.

I couldn't stomach this, so I rewrote it.
Question #2: anyone object to my change?  I have tested
it with my attached test program, and I appear to have
gotten it right, but...

Thoughts?  Comments?  Flames?  Suggestions I go back to my day job?
<grin>

Cheers,

Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmm.patch
Type: text/x-patch
Size: 14577 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20041009/1f8e26eb/winmm.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timetest.tgz
Type: application/x-compressed-tar
Size: 29276 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20041009/1f8e26eb/timetest.bin


More information about the wine-devel mailing list