Re: Multi-threaded UI Freezes on GDK Call

2007-12-20 Thread Michael McCann
Emmanuele Bassi wrote: > On Tue, 2007-12-18 at 20:37 -0500, Michael McCann wrote: > > >> Yes, I've already tried that, to no avail. My code basically only >> consists of: >> >> gdk_screen_get_default(): Get the default screen >> gdk_s

Multi-threaded UI Freezes on GDK Call

2007-12-18 Thread Michael McCann
I've got a multithreaded GTK application. One thread runs gtk_main(): gtk_threads_enter(); gtk_main(); gtk_threads_leave(); The other thread is an infinite loop that sleeps for one second on each loop. Every x seconds, the infinite loop calls a function, which makes some GDK calls. At the begin

Re: Multi-threaded UI Freezes on GDK Call

2007-12-18 Thread Michael McCann
Brian J. Tarricone wrote: > Michael McCann wrote: > >> Brian J. Tarricone wrote: >> >>> Don't use gdk in the CPU-intensive function: >>> >> Unfortunately, the GDK calls _are_ what is CPU-intensive. I believe the >> gdk_pixbuf_ge

Re: Multi-threaded UI Freezes on GDK Call

2007-12-18 Thread Michael McCann
Michael R. Head wrote: > I'll break protocol and reply to my own message _again_... > > On Tue, 2007-12-18 at 19:05 -0500, Michael R. Head wrote: > >> On Tue, 2007-12-18 at 18:46 -0500, Michael McCann wrote: >> >>> Ahh, ok. How else can I accomplish

Re: Multi-threaded UI Freezes on GDK Call

2007-12-18 Thread Michael McCann
Brian J. Tarricone wrote: > Michael McCann wrote: > >> Michael R. Head wrote: >> >>> Does your special function take time to do its job? If so, then that >>> would be why. For example: >>> >>> ... >>> while(1) { >>>

Re: Multi-threaded UI Freezes on GDK Call

2007-12-18 Thread Michael McCann
Tomas Carnecky wrote: > Michael McCann wrote: >> Michael R. Head wrote: >>> On Tue, 2007-12-18 at 17:14 -0500, Michael R. Head wrote: >>> >>>> I assume you meant >>>> >>>> g_threads_init(); >>>> gdk_threads_init(

Re: Multi-threaded UI Freezes on GDK Call

2007-12-18 Thread Michael McCann
Michael R. Head wrote: > On Tue, 2007-12-18 at 17:14 -0500, Michael R. Head wrote: > >> I assume you meant >> >> g_threads_init(); >> gdk_threads_init(); >> gtk_init(); >> >> gdk_threads_enter(); >> gtk_main(); >> gdk_threads_leave(); >> >> right? >> Yes, that i

Multi-threaded UI Freezes on GDK Call

2007-12-18 Thread Michael McCann
I've got a multithreaded GTK application. One thread runs gtk_main(): gtk_threads_enter(); gtk_main(); gtk_threads_leave(); The other thread is an infinite loop that sleeps for one second on each loop. Every x seconds, the infinite loop calls a function, which makes some GDK calls. At the begin