PATCH: PeekMessage - reducing load

Francois Gouget fgouget at free.fr
Fri May 18 18:22:33 CDT 2001


On Sat, 19 May 2001, Ove Kaaven wrote:

> 
> On Fri, 18 May 2001, Marcus Meissner wrote:
> 
> > winword.exe apparently uses a while (PeekMessage()) loop. 
> > 
> > Both wineserver and 1 wine thread take up 90% CPU even if idle.
> > 
> > This adds a timeout of 10 milliseconds so we are still interactive, 
> > but do not take up as much CPU. (We basically wait 1 timeslice if 100HZ
> > scheduling).
> 
> I question this... an app could be doing something important in such a
> loop, i.e. while (!PeekMessage()) do_a_piece_of_important_stuff(), and
> this would severely slow down things like that. In particular, I expect a
> lot of games to use such loops. If you need CPU time reduction, at least
> make it configurable.

   Me too. There are (badly written) applications that suffer greatly
from this. Furthermore I did some tests on Win 95 and Word 97 only does
that with some files, not all. Also, Word 2000 no longer behaves that
badly.

   Now, if it were a per application setting it could make sense.

--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
  Any sufficiently advanced Operating System is indistinguishable from Linux





More information about the wine-devel mailing list