--%>

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 Bounds Bounds : It is the limits

    Bounds: It is the limits of an array or collection. In Java, the lower limit is for all time zero (0). In case of an array, the upper bound is one less than the length of the array, and is fixed. Indexing exterior the bounds of an array or collection

  • Q : Explain the differences between HTML

    Explain the differences between HTML and XML?

  • Q : Template class and class template in

    Illustrate the difference between a template class and class template in the programming?

  • Q : Define the term Static type Define the

    Define the term Static type: It is the static type of an object is the declared type of the variable employed to refer to it.

  • 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 Number of Interleavings Number

    Number of Interleavings: Besides the raw number of threads, the state space is affected by the number of potential interleavings of these threads. While there exist automated techniques (partial-order reduction) to reduce these interleavings, most mod

  • Q : Define the term Mutual recursion Define

    Define the term Mutual recursion: Recursion which outcomes from two methods calling one other recursively.

  • Q : What is an Arithmetic expression

    Arithmetic expression: It is an expression comprising numerical values of integer or floating point kinds. For example, operators like +, -, *, / and % get arithmetic expressions as their operands and generate arithmetic values as their outcomes.

  • Q : Ways in which Java program is less

    Give two ways in which a Java program is less likely to be compromised than the same program written in C++.

  • Q : Define Final class Final class : This

    Final class: This is the class with final reserved word in its header. A final class might not be extended by the other class.