--%>

Use of setjmp and longjmp

Use of setjmp() and longjmp(): In C/C++, setjmp() saves the contents of the registers at a particular state in the program and longjmp() will restore that state later. In this way, longjmp() “returns” to the state of the program when setjmp() was called.

In general these functions are problematic for C++ because they do not support C++ object semantics. In particular, they do not ensure the proper destructor calls and so objects may not be cleaned up properly, leaving the system in a bad state.

Using these functions may also degrade performance by preventing optimization on local variables. For C++ exception handling, try/catch constructs are recommended instead.

214_serjmp.jpg

For model checking in particular, non-hierarchical long jumps are difficult to model with modeling languages like Java. These functions need to do register restoration which requires modeling of registers and their related operations, adding considerable overhead to model-checking effort.

   Related Questions in Programming Languages

  • Q : Assembly program that reads in five

     I need to write assembly program that reads in five numbers from the user. The user can then be prompted for one of the following pieces of information to be computed and returned: . the mean of the five numbers; . the largest number in the set; . the smallest number in the set; . t

  • Q : Explain the term Test Fusion Report of

    Explain the term Test Fusion Report of QTP?

  • Q : Give some instances of XML DTDs or

    Give some instances of XML DTDs or schemas which you have worked with?

  • Q : Define the term Interprocess

    Define the term Interprocess communication: It is the ability of two or more separate processes to communicate with each other.

  • Q : Main uses of Virtual memory Illustrate

    Illustrate the main uses of Virtual memory?

  • Q : Software Quality Assurance and Software

    What real-life experience have you gained along with Software Quality Assurance as well as Software Quality Control?

  • Q : Define the term createWindow object

    Define the term createWindow object? Answer: reateWindow() physically makes the Window in memory  based upon the earlier registered WND

  • Q : Define the term Protected statement

    Define the term Protected statement: It is a statement within the try clause of the try statement.

  • Q : Define Accessor method Accessor method

    Accessor method: A technique specifically designed to offer access to a private attribute of a class. By convention, we name accessors with a get prefix followed by the name of the attribute being accessed. For example, the accessor for an attribute n

  • Q : Define Final variable Final variable :

    Final variable: A variable with final reserved word in its declaration. The final might not assigned to once it has been initialized. Initialization frequently occurs as a part of its declaration. Though, the initialization of an uninitialized final f