Windows port polling

Richard Wilson richard.wilson at
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) {



                } else if (!active) {

                                SetTimer(NULL, 0, timeout, NULL);





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?





Richard Wilson, Director

In Keeping Ltd.


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...

More information about the netsurf-dev mailing list