C++ Exception-Handling Tricks for Linux
By Sachin O. Agrawal2005-04-12
Handling Exceptions in Multi-Threaded Programs
Sometimes exceptions are left un-caught, which will cause the process to abort. Many times, however, processes contain multiple threads, where a few threads perform the core application logic while the rest service the external requests. If a service thread does not handle an exception due to programming error, it will kill the whole application. This may be undesirable as it promotes denial-of-service attacks by feeding illegal requests to the application. To avoid this, an un-caught handler can decide whether to invoke an abort or a thread-exit call. This is demonstrated towards the end of the ExceptionHandler::SingleTonHandler::Handler() function in Listing 3.
Tutorial Pages:
» Four Techniques for Dealing with Built-in Language Limitations
» Retaining exception source information
» Managing Signals
» Managing Exceptions in Constructors and Destructors
» Handling Exceptions in Multi-Threaded Programs
» Conclusion
» Resources
First published by IBM DeveloperWorks
| Related Tutorials: » How to Install PHP 5 on Linux » How to Install Apache 2 on Linux » How to Install MySQL 5.0 on Linux » SMB Caching » Mound --Bind » Tar Wild Card Interpretation |
