[gtkmm] Re: pthreads with gtk/gtkmm



>I am trying to use 2 separate threads for the GUI and audio part of an 
>application. (following some suggestion coming from the list some months ago)
>
>I have tryed to create a pthread with the entire gtkmm GUI code, but I get a 
>segmentation fault from the constructor of my gtkWindow-inherited class.
>
>To do this, I have created a function that contains Gtk::kit, the 
>instantiation of my GtkWindow class and kit.run().
>
>I have seen on web and newsgroups that POSIX threads and C++ do not mix 
>easily, but I was not able to find anything directly related to my problem.
>Can anyone help?

there is absolutely no problem mixing pthreads, C++, GTK+ and
gtkmm. you need to understand multithreaded programming, which is not
trivial, and it is best if you stick to the model that only one thread
ever calls gtkmm/GTK+/GDK/Xlib functions. the latest gtkmm has a nice
class (called Dispatcher, i forget which namespace) that makes this
rather easy to do.

but i repeat: there are no problems doing this (i've been doing it for years).

--p



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