Re: signals and threads



Dmitry A. Yanko wrote:
On Mon, Dec 05, 2005 at 11:55:57AM -0500, Daniel Atallah wrote:

You can use g_idle_add() to trigger your UI updates from your data
processing threads.

Ok. Thanks a lot. I will try.
Will it also resolve my hignal handlers problem?

Every signal callback registered to a GSignal will be called
when that signal is emitted, in the thread context in which
the signal was emitted, period.

In other words, you never had a signal handler problem.

On the other hand, it is perfectly sane and fine to
register/unregister a signal callback from thread A or
from thread B, either way the callback will be run
in the calling context of the code segment which emitted
the signal (ofcourse, you must protect the object you
are toying with, so that both threads dont register/
unregister to that object simultaniously).

Cheers,
                                -Tristan




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