Re: [gtkmm] Glib::Dispatcher slow response



Why do you have two threads? You could insert the fd of the driver as one of the sources for the GTK main loop, and handle it as just one more event in the main thread.
Also, do you know what the main thread is doing while it's frozen?

Michael Van Damme wrote:


Hi,

I have a small multithreaded app that communicates with a device connected to the serial port.
At the moment, there are only two threads:
1. A communication thread, that waits for data from the device (communication with the device happens
with a kernel module).
2. The main thread (thread with the gtkmm mainloop). This thread displays the data received from the device.

I'm using Glib::Dispatcher to display data I receive from the device in the main thread. Sometimes, everything works fine after starting the communication. Sometimes, however, after starting the communication I receive data, but is isn't being shown on the screen. The window remains frozen for about 10 to 15 seconds before the output starts. During this time, the commucation thread is emitting signals through the dispatcher, but the function that handles these signals in the main thread just isn't being called. After about 15 seconds,
the problem disappears, and everything runs perfectly.

Does anyone know what I'm doing wrong?

Thanks,
Michael

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list





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