by Rick Winterton, Intel Corp.
Challenge
Implement software exception handling for the Intel® C++ Compiler that is compliant with the Microsoft Structured Exception Handling (SEH) implementation. There are, in general, two types of exceptions.
- Asynchronous exceptions: those exceptions that come unexpectedly, similar to an interrupt in a program that takes you immediately away from the thread context you are executing to a context that is different from that which caused the exception.
- Synchronous exceptions: those exceptions that are planned and handled in an organized manner. The most common type of synchronous exception is implemented as a "throw."
The following sample code shows asynchronous exception handling:
ISO standard exception handling is a set of entry points provided to the user to handle predefined conditions. These entry points consist of the following:
- catch -
- throw -
- try -
The exception type may be one or more type names separated by commas. Handlers within try blocks catch the corresponding exceptions.
Microsoft SEH is a set of Windows functions provided by the operating system. Microsoft Visual C++ abstracts these functions via non-standard keywords and library routines. Other vendors may choose different ways to achieve similar results by calling the same functions. To support SEH, Microsoft extends the C and C++ languages with four keywords:
A function defines which exceptions it raises with an exception specification:
![]()
![]() | Integrating Java and Microsoft .NET by Jon Jagger, Content Master Ltd. Intel Corp. The right techniques... |
![]() | Multithreaded technology and multi-core processors by Craig Szydlowski, Infrastructure Processor Division, Intel Corp. ... |
If you're interested in this topic, these articles may be helpful:
![]() | Intel® Threading Building Blocks (TBB) Intel® Threading Building Blocks (TBB) offers a rich and complete ... |
![]() | Managing exceptions in Web services environments from AmberPoint Inc. Web services present us with a standards-base... |
![]() | DevPartner for Visual C++ BoundsChecker Suite DevPartner for Visual C++ BoundsChecker Suite is a powerful set of sof... |
![]() | Intel® TBB for Open Source Threading Building Blocks (TBB) is an award-winning C++ runtime librar... |
![]() | Practical C++ Programming, 2nd Edition by Steve Oualline, O'Reilly Media Inc. C++ is a powerful, highly fl... |
![]()
Related Jobs:


