Re: [gtk-list] gtk and threads
- From: katre <katre mousetrap ml org>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] gtk and threads
- Date: Wed, 16 Dec 1998 11:47:41 -0500 (EST)
>
>
> Has anyone used gtk clist with threads?
>
> It appears to me that gtk doesn't like to be messed with from two (or more
> threads).
>
While I haven't used clist, I am writing a threaded program which uses gtk.
And you're right, you can't call gtk functions from the other thread. What
I did was to set up queues, protected by mutexes, to send data from oine
thread to another. The the gtk thread runs in a loop, first checking the
queue and taking any appropriate actions, then calling a function like
while (gtk_events_pending())
gtk_main_iteration();
to update the screen. This has given me fairly good results, and my crashes
aren't due to this, but to all of my other mistakes.
katre
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]