Re: GTK+ & GLib threads



On Thu, 02 Sep 2004 00:10:09 -0400, Todd Fisher <taf2 lehigh edu> wrote:
    You should not use any GUI calls in your background thread.  It
would be better to use something like GAsyncQueue,
in combination with a timeout function, to send notification to the GUI
thread, that it should update itself in someway.
You might find it very useful to search through the archives of this
mailing list, as this topic has come up quiet often.

I found this mail from Paul Pogonyshev very helpful:

http://mail.gnome.org/archives/gtk-app-devel-list/2004-July/msg00176.html

It shows how to get a background thread to post data to the GUI thread
over an GAsyncQueue, and have the GUI thread woken up automatically
(no timeout polling). I was using a pipe for this and having awful
problems on win32. With Paul's code I have a slick cross-platform
threaded app, very nice.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]