--%>

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 : Differences between XHTML and HTML

    Explain the differences between XHTML and HTML?

  • Q : Explain Method overriding Method

    Method overriding: It is a method stated in a super class might be overridden by a method of similar name stated in a sub class. The two methods should have similar name and number and types of formal arguments. Any checked exception thrown by sub-cla

  • Q : What is Cursor Cursor : This is a

    Cursor: This is a visual representation of the existing position of the mouse on the user's virtual desktop. Cursor shapes are frequently set to symbolize the current state of a program – utilizing an hour glass shape to point out that the user

  • 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 : Illustrates the difference between

    Illustrates the difference between Property Get, Let and Set?

  • Q : Define Bogor Bogor (Robby, Dwyer, and

    Bogor (Robby, Dwyer, and Hatcliff 2006) is an extensible software model-checking framework which includes: Software model checking algorithms Visualizations A user interface designed to

  • Q : Describe Unnamed package Unnamed

    Unnamed package: All classes defined in the files without a package declaration are placed in an unnamed package.

  • Q : What do you mean by Class variable What

    What do you mean by Class variable: It is a synonym for the static variable.

  • Q : ERD What is the meaning ofDerive the

    What is the meaning ofDerive the department and staff relations from the following ERD.

  • Q : Explain Assignment operator Assignment

    Assignment operator: The operator (=) employed to store the value of an expression into the variable, for example: Variable = expression; The right-hand