On Tue, 2013-04-30 at 10:44 +0100, jcupitt gmail com wrote:This is one-way. How about two-way communication between threads?
> You can do this very simple and reliably. For example:
>
> worker()
> {
> char *str;
>
> for(;;) {
> str = g_strdup("hello world!\n");
> g_idle_add(from_worker_cb, str);
> sleep(1);
> }
> }
>
> gboolean
> from_worker(char *str)
> {
> update_textview(str);
> g_free(str);
> return FALSE;
> }
this would depend on the how much you need here. between only two threads you could get away with the 2nd option. more than that, and you should go with the first.