Re: [gtkmm] Thread communication



On Tuesday 03 February 2004 9:40 am, Paulo Pinto wrote:
> AFAIK there isn't a function like that in gtkmm but
> you could have one of the threads waiting in a
> mutex/semaphore.
>
> The other thread would fill up some data structure
> and then signal the other thread by release the
> mutex/semaphore.
>
> I hope this helps.
>
> --
> Paulo Pinto
>
> Benoît Touron wrote:
> > Hello there !
> >
> > Is it a way to send a message from a thread to another, in order to
> > start execution of a function in another thread.
> > Under Win32, I would use a PostThreadMessage.
> > Is it simething equivalent under GTKMM ?
> >
> > Thanks

Use Glib::Dispatcher.  If you need to pass data, push the data onto a queue in 
the sending thread, and pop it off in the receiving thread (but use a mutex 
if you could get concurrency and your standard library is not thread safe).

Chris.




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