Question: I have used Signals and slots in Qt and I want to implement same stuff in GTK+. 

I have 2 threads in which I need to pass data. I have done it using signals and slots in Qt but now I have to implement this same stuff in GTK+ and C. How should I do it?

Answer: 
[Here](http://zetcode.com/tutorials/gtktutorial/gtkevents/)'s a general tutorial for the signal/event mechanism without threads.

When using threads, you'll have to make sure to

* init the Gtk main loop for threads by calling [g\_thread\_init()](http://library.gnome.org/devel/glib/unstable/glib-Threads.html#g-thread-init) **and** [gdk\_threads\_init()](http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#gdk-threads-init).
* use [gdk\_threads\_add\_idle()](http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#gdk-threads-add-idle) **or**
* use [GDK\_THREADS\_ENTER()](http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#GDK-THREADS-ENTER:CAPS) and [GDK\_THREADS\_LEAVE()](http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#GDK-THREADS-LEAVE:CAPS) in the callback (= event handler).

There are probably hundreds of tutorials for threading in Gdk out there, so I'll leave it at that.
Qt does some of its own stuff behind the scenes to make signal/slot connections threadsafe. The last I was working with GTKmm, that wasn't the case for GTK. That being the case, you'd probably have to do up your own, or (my recommendation) use boost if you can. If you do have to roll your own, you'll want to have an event posting/polling mechanism. They aren't overly complex, but are enough of a pain you should definitely prefer pre-built solutions.