Re: Multithreading application



> Hi
> I am using gtkmm. i need multithreading in my application. so in one
> thread i need to open a simple window which contain label in another
> thread i need to do other application. please help me regarding this.
>
> i have this window class.
>
> class NewWindow:public Gtk::Window
> {
> .
> .
> .
> };
>
> i need to create instance of this class  and run it in one thread.
Do you need twoWindows in two seperate threads? You probably can acheive
what you want by having one GUI thread and one worker thread.

Take a look at the thread examples in the glibmm documentation:
http://www.gtkmm.org/docs/glibmm-2.4/examples/thread/
thread.cc shows the use of thread, mutex and condition
dispatcher.cc shows the use of a dispatcher to communicate from a worker
thread the main thread (e.g. your GUI thread)
dispatcher2.cc shows the use of dispatchers to communicate back and
forth between a main thread and a worker thread with a GLib MainLoop
running in it.

You probably could also start a new window in a worker thread (which
comes with its own main loop). But I am not sure about this.



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