Re: MainLoop & 100% CPU
- Date: Fri, 23 Nov 2007 02:18:42 +0800
- From: "Kuang-Chun Cheng" <kcc1967@xxxxxxxxx>
- Subject: Re: MainLoop & 100% CPU
I don't know what happened. I saw the same problem as you which only
happen in glib win32 port. Maybe a bug ?? But there is an easy fix ... just add an idle callback
which call g_usleep() regularly ... that fix the CPU issue for me.
KC
On Nov 22, 2007 9:31 PM, Ouanilo Jérôme Medegan <ouanilo.pro@xxxxxxxxx> wrote:
Hi,
Newbie to GLib, i've began design a little program based on this library. The problem is that my proggie always eats 100% of CPU. I've then made a tiny prog just to isolate the problem and finally got this code as Main Function :
#include "windows.h"
#include "glib.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
GMainLoop *MainLoop = NULL;
MainLoop = g_main_loop_new(NULL, TRUE);
g_main_loop_run(MainLoop);
}
Even this minimalist program eats 100% CPU. And i don't have any idea of what i'm doing wrong. So if there is something i've forgotten to do, please help me to understand :).
For information, i'm under Microsoft Visual Studio 2005 & using glib 2.12.9 (win32-dev)..
Thx for reading..
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list
_______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list
- Follow-Ups:
- Re: MainLoop & 100% CPU
- From: Ouanilo Jérôme Medegan
- Re: MainLoop & 100% CPU
- References:
- MainLoop & 100% CPU
- From: Ouanilo Jérôme Medegan
- MainLoop & 100% CPU
- Prev by Date: MainLoop & 100% CPU
- Next by Date: Re: MainLoop & 100% CPU
- Previous by thread: MainLoop & 100% CPU
- Next by thread: Re: MainLoop & 100% CPU
- Index(es):