--%>

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 : What do you mean by the term JFC What

    What do you mean by the term JFC? Describe in brief.

  • Q : Define the reasons of Process Handle

    Define the reasons of Process Handle Table.

  • Q : Short lock in the tibco iProcess

    Describe the term short lock in the tibco iProcess in brief.

  • Q : State Sub type Sub type: It is a type

    Sub type: It is a type with a parent super type. The sub-type or super-type relationship is more common than the sub-class or super-class relationship. A class which implements an interface is a sub type of interface. An interface which expands the ot

  • Q : Explain Synchronized statement

    Synchronized statement: It is a statement in which an object-lock should be obtained for the target object prior to the body of the statement and can be entered. Employed to enclose a critical section in order to save a race hazard.

  • Q : Define the term Statement terminator

    Define the term Statement terminator: The semicolon (;) is employed to point out the end of a statement.

  • Q : How XML web services integrate two

    How can XML web services integrate two legacy distributed systems, one based on Corba and one based on Java RMI?

  • Q : Explain Copy constructor Copy

    Copy constructor: It is a constructor which takes a single argument of similar class. For illustration:     public class Point {        

  • Q : Explain the meaning of semantic

    Explain the meaning of semantic connotations.

  • Q : Problem on Vectors Create a vector

    Create a vector representing x coordinates of a measurement with 20 points between 0 and 10. Create another vector y representing fake measurements which are related to the above x values as y = 2.3 x – 1.2. Next add random (normal, Gaussian) noise to the vector