LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] signals and c++

[ILUG] signals and c++

Caolan McNamara cmc at stardivision.de
Wed Feb 2 11:43:50 GMT 2000


>>>>>>>>>>>>>>>>>> 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 
one cool
> approach to making C++ code deal with Unix signals in an elegant way.  
The
> 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.


> B

> --
> Brendan Kehoe

> Web page: http://www.zen.org/~brendan/







More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell