Scope S3 is nested in scope S2 which is nested in scope S1. Assume that fault handlers for fault f exist in each scope and that compensation handlers C2 and C3 have been declared in S2 and S3. In each of the following cases, either explain how the specified sequence of events might happen or why the sequence is impossible

a. Suppose f is raised in S2 after S3 has exited normally and C2 is entered before C3.
b. Suppose f is raised in S2 after S3 has exited normally and C3 is entered.
c. Suppose f is raised in S1 after S2 has exited normally and C2 is entered before C3.
d. Suppose f is raised in S1 after S2 has exited normally and C3 is entered before C2.
e. Suppose f is raised in S1 after S2 has exited normally, no handler for f has been declared in S1. Describe the sequence of events that occurs.
f. Suppose f is raised in S1 after S2 has exited normally, no handler for f has been declared in S1, and no compensation handler has been declared in S2. Describe the sequence of events that occurs.
g. Suppose f is raised in S1 after S2 has exited normally, no handler for f has been declared in S1, and no compensation handler has been declared in S2. Describe the sequence of events that occurs.

a. Cannot happen. The only way C2 can be entered is as the result of a call from the fault handler in S1. But S2 must have exited abnormally, so C2 is not installed.
b. The fault handler in S2 calls C3.
c. The fault handler in S1 invokes C2, which in turn invokes C3.
d. Cannot happen. The only way C3 can be entered in this case is via a call from C2.
e. The default fault handler for f in S1 will be called. Since C3 has been declared in S2, it will be called and it might invoke C3. The default handler will reraise f in the immediately enclosing scope.
f. The default fault handler for f in S1 will be called. Since there is no explicitly declared compensation handler for S2 it will reraise f in the immediately enclosing scope.
g. The default fault handler for f in S1 will be called. Since there is no explicitly declared compensation handler for S2 it will reraise f in the immediately enclosing scope.

Computer Science & Information Technology

You might also like to view...

FTP ____________________ are one of the main resources for storing files on the Internet.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The icon labeled 1 in the accompanying figure represents the ____ command.



a. Layer, Align, Top Edges
b. Layer, Align, Vertical Centers
c. Layer, Align, Left Edges
d. Layer, Align, Right Edges


Computer Science & Information Technology