Re: Multi-thread problem

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

 





2008/9/23 Chris Moller <moller@xxxxxxxxxxxxxx> sais:

Accordingly, my GTK wrapper uses two threads, one that responds to user
interaction to pipe things to the utility, another that loops on a
blocking read of a pipe from the utility...

Sorry, the fact that you are reading and writing asynchronously does not mean that you need two threads. You may instead use gtk_input_add() to add a callback when there is something to read on stdin.

If you really need to use 2 threads, then only one of them (the one you called gtk_main from) should call any gtk/gdk command. The second thread may, as Anthony wrote, pass info to the first thread through g_idle_add.

Regards,
Dov


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux