Re: Handling Unix signals in a GTK+ application



[Using a pipe] is generally the best way of dealing
with asynchronous (Unix) signals, but for simple
cases another approach is just to set a flag of type
volatile sig_atomic_t in the Unix signal handler,
and then check and act on the status of the flag in
the glib event loop with an idle handler set up with
g_idle_add().

The downside of that approach is that you have to
busy-wait on that flag, while the pipe approach allows
the application to be completely idle (and still have
fast response to the signal)... I went with the pipe
approach; using the sample code referred to by another
poster, it turned out to be pretty easy.

Thanks to everybody for your help!

 - Thomas

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



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