Re: Help: multithreaded GNOME app



Set up a pipe(), and pass one of the fds as an input source to Gtk+. 
Gtk+ will then call your callback function whenever data arrives over
the pipe. 

	Jeff



On Mon, 1 Feb 1999, Jason Tackaberry wrote:

> > A semaphore could be an integer variable that shifts values between 0 and
> > 1.  If it's 0 someone is using a gtk call, the process that is using the
> > gtk call can return, and then set the semaphore to 1 which indicates that
> > the thread is done and whatever process blocking on the semaphore is free
> > to make the call.  semaphores are supported in Linux check out "man -k
> > semaphore"
> 
> I'm not actually sure how this solves my problem.  You said I can use
> semaphores to monitor the queue, but how do I monitor the state of the
> semaphore?  Remember, my intent was to have one thread handle gtk+ calls (the
> thread that calls gtk_main()).  I doubt there's a gtk_monitor_semaphore
> function. :)  On the other hand, it's entirely possible I'm being an idiot and
> completely missing your point.  If that's the case, some pseudocode might help
> this thick head figure out what you mean. :)
> 
> Thanks,
> Jason.
> 
> 
> -- 
>         FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
>          To unsubscribe: mail gnome-list-request@gnome.org with 
>                        "unsubscribe" as the Subject.
> 
> 



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