Windows port polling

Richard Wilson richard.wilson at inkeeping.com
Mon Feb 7 15:28:05 GMT 2011


Hi All,

The Windows' port currently never idles in gui_poll, causing it to use all
available processing power. One solution is to update windows/schedule.c to
match it's framebuffer counterpart (to return the time until next scheduled
event), and then simply extend gui_poll to:

 

void gui_poll(bool active)

{

                int timeout; /* timeout in miliseconds */

 

                /* run the scheduler and discover how long to wait for the
next event */

                timeout = schedule_run();

 

                MSG Msg;

                if (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE) != 0) {

                                TranslateMessage(&Msg);

                                DispatchMessage(&Msg);

                } else if (!active) {

                                SetTimer(NULL, 0, timeout, NULL);

                                WaitMessage();

                }

}

 

One thing to note here is that while the current scheduling code (see
framebuffer/schedule.c) states that the time until next event is in
centiseconds, it's actually milliseconds. Any comments?

 

 

R.

  _____  

Richard Wilson, Director

In Keeping Ltd.

Web: www.inkeeping.com

Tel: +44 (0)1427 848525

 

This e-mail has been sent from In Keeping Ltd, registered in England and
Wales company number 7267430. Registered office: 52 High Street, Beckingham,
Doncaster, South Yorkshire. DN10 4PB, UK.

 

Think before you print! Do you really need to print this email?

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://vlists.pepperfish.net/pipermail/netsurf-dev-netsurf-browser.org/attachments/20110207/0a47e553/attachment.htm


More information about the netsurf-dev mailing list