--%>

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 : Define Unconditional Jumps

    Unconditional Jumps: Jumps which are not strictly upwards in the block hierarchy can require extensive control-flow manipulation, including creation of redundant code, and should be avoided if possible. Such jumps add considerable modeling overhead fo

  • Q : Define the term Method signature Define

    Define the term Method signature: This is the synonym for method header.

  • Q : Explain the relationship between XHTML

    Explain the relationship between XHTML and URL?

  • Q : Define the Binding of Instructions and

    Define the Binding of Instructions and Data to Memory?

  • Q : What are Logical operators Logical

    Logical operators: The operators, like &&, ||, &, | and ^ which take two Boolean operands and generate a Boolean outcome. Employed as part of a Boolean expression, frequently in the condition of the control structure.

  • Q : Explain the term Portable Portable :

    Portable: The Portability is the quality of a program which makes it probable to run it on different kinds of computers. The programs written in low level languages are usually not very portable since they are generally closely tied to a particular in

  • Q : Write a program to display its negative

    Write a program in object code that reads a single digit decimal number and displays its negative in binary.  To do this, you must first read the number as a character and then convert it to its numeric value, as discussed in class.  Then, you're going to change this to a negative numbe

  • Q : How can I check while a web page

    How can I check while a web page contains exact text?

  • Q : Create a BottomUpTwoThreeFourTree class

    You will need to create a BottomUpTwoThreeFourTree class, with a BottomUpTwoThreeTreeFourTree constructor which keeps no parameters. BottomUpTwoThreeTreeFourTree will require an insert(int x) method, which will insert the value 

  • Q : Define Applet Applet : The Applets are

    Applet: The Applets are Java programs based on the Applet or JApplet classes. They are closely related with the capability to give active content within the Web pages. They have numerous features that differentiate them from ordinary Java graphical ap