--%>

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 the term Field Define the term

    Define the term Field: Variables stated within a class or interface, exterior of the methods. The fields are members of a class.

  • Q : Define Delegation Delegation : The

    Delegation: The procedure by which an object passes on a message has received to a sub-ordinate object. When inheritance is not accessible in a programming language, then delegation is the most viable option for ignoring code duplication and promoting

  • Q : Explain the term Test Fusion Report of

    Explain the term Test Fusion Report of QTP?

  • Q : Define the term Assignment statement

    Define the term Assignment statement: It is a statement employing the assignment operator.

  • Q : What do you mean by the term JFC What

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

  • Q : Double clock signal in synchronous

    Describes the cases where you need to double clock a signal before presenting this to a synchronous state machine?

  • Q : What do you mean by program counter

    What do you mean by the term program counter? Write down its use?

  • Q : Explain the purpose of using XML

    Explain the purpose of using XML.

  • Q : Different services provided by DLR to

    Give details about the different services that are provided by DLR to CLR?

  • Q : What is Primitive Type Casting

    Primitive Type Casting: C/C++ allows you to cast between totally unrelated types. This can be problematic for model checking. Avoid type casting between unrelated types and in particular primitive types. For example,

    Discover Q & A

    Leading Solution Library
    Avail More Than 1415143 Solved problems, classrooms assignments, textbook's solutions, for quick Downloads
    No hassle, Instant Access
    Start Discovering

    18,76,764

    1948750
    Asked

    3,689

    Active Tutors

    1415143

    Questions
    Answered

    Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!

    Submit Assignment

    ©TutorsGlobe All rights reserved 2022-2023.