--%>

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 Livelock Livelock : It is a

    Livelock: It is a situation in which a thread waits to be notified of a condition however, on waking, finds that the other thread has inverted the condition another time. The primary thread is forced to wait again. Whenever this occurs for an indefini

  • Q : ID of TC Trustcenter Publisher and

    For how long are ID of TC Trustcenter Publisher and certificates of developer valid?

  • Q : Define Reserved word Reserved word : It

    Reserved word: It is a word reserved for a particular purpose in Java, like: class, int, public, and so forth. These words might not be employed as ordinary identifiers.

  • Q : Explain Aggregation Aggregation : It is

    Aggregation: It is a relationship in which an object has one or more other subordinate objects as portion of its state. The subordinate objects usually have no self-governing existence separate from their containing object. Whenever the containing obj

  • Q : Use the Alice Program Use the Alice

    Use the Alice Program from the link below to complete and save the five projects . http://alice.org/ (should be Alice 2.2 or newer) Assignment 1

    Q : What are the examples of microkernel

    What are the examples of microkernel?

  • Q : Explain Object reference Object

    Object reference: It is a reference to an object. Languages other than Java employ terms like pointer or address or. It is significant to keep the difference clear between an object and its reference. The variable like argo

    Q : Explain One Dimensional array One

    One Dimensional array:1) An array is a continuous memory location having similar kind of data in a single row or single column. Declaration in c++ is as under: const int size = 20;int a[size] or int a[2

  • Q : Networking Homework Assignment : A

    Homework Assignment : A Barbershop Problem Due: November 20, 2012 In this assignment, you are asked to write a multithreading problem to simulate the barbershop problem, which is a classical synchronization problem. The problem is taken from William Stallings's Operating Systems: Internals and D

  • Q : What do you mean by data movement What

    What do you mean by data movement? Describe in brief.