>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 02.02.00, 12:33:03, Brendan Kehoe <brendan at zen.org> wrote regarding
Re: [ILUG] signals and c++:
> > In the absence of such massive cleverness though I imagine that Im
> > just going to have to live with the ugliness of signals crapping all
> > over the destructors of a program, unless anyone has any cunning
> > ideas.
> Doug Schmidt had an interesting article in C++ Report a while ago
> (cf. http://www.cs.wustl.edu/~schmidt/signal-patterns.html) offering
> approach to making C++ code deal with Unix signals in an elegant way.
> stuff in his ``ACE wrappers'' package also offers a solution.
Hmm, it looks like the best practical approach, but it still has its
problems. A signal is caught and basically a flag set which gets
tested at some fixed point during the execution. So in his final
example if a SIGINT was received during do_work() then the program
would only shutdown after the do_work() thingy finished. So if the
program was stuck in do_work() you couldn't use a SIGINT to shutdown.
As the signal would be caught and its handing deferred until the
explicit test in the loop.
I'll just have to accept that you can't squish round pegs into square
holes and expect a perfect fit.
> Brendan Kehoe
> Web page: http://www.zen.org/~brendan/
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!