save cpu !

gerard patel g.patel at wanadoo.fr.invalid
Wed Oct 17 18:28:38 CDT 2001


On Wed, 17 Oct 2001 22:55:23 +0200, Olivier Scalbert
<olivier.scalbert at algosyn.com> wrote:

>Hello everybody !
>
>I have just installed Wine. I have test it with several programs and I
>find it is wonderfull !
>When I am running MSWLogo (a Logo environment) on Wine, it eats all my
>CPU.
>The problem is not very important if I start one session, but if I start
>several sessions, it becomes a real problem.
>In our school we have a big Linux server and 24 x-terms ...
>
>Is it possible to introduce a delay of several ms somewhere inside the
>Wine source code ?
>Any ideas are welcomed !

It's probably possible to hack something if you are
ready to edit source C code and compile the thing
yourself. 
For example, change dlls/user/message.c around
line 1212 in current cvs (where you have the comment
'no message available'), to add a sleep if there are
several consecutives occurences of this event (that
is no message available)
Something like that (not sure if this will work :-))

--- message.c.orig      Wed Oct 17 21:33:48 2001
+++ message.c   Wed Oct 17 23:26:41 2001
@@ -1170,6 +1170,7 @@
     ULONG_PTR extra_info = 0;
     MESSAGEQUEUE *queue = QUEUE_Current();
     struct received_message_info info, *old_info;
+    static int toto = 0;
 
     if (!first && !last) last = ~0;
 
@@ -1209,7 +1210,14 @@
         }
         SERVER_END_VAR_REQ;
 
-        if (!ret) return FALSE;  /* no message available */
+        if (!ret)
+        {
+             toto++;
+             if (toto >= 10) Sleep(10);
+             toto = 0;
+             return FALSE;  /* no message available */
+        }
+        toto = 0;
 
         TRACE( "got type %d msg %x hwnd %x wp %x lp %lx\n",
                info.type, info.msg.message, info.msg.hwnd,
info.msg.wParam, info.msg.lParam );4

Gerard



More information about the wine-users mailing list