Re: Help: multithreaded GNOME app



> 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.



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