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...

A __________ contains enough bits (usually eight) to represent a single character.

a. word b. string c. couplet d. byte

Computer Science & Information Technology

All processes running on a computer must be monitored periodically with the ____ command to check for rogue or malfunctioning processes.

A. mn B. pr C. ps D. show

Computer Science & Information Technology

Which mailx command displays all commands that can be issued at the interactive prompt?

A. list B. type C. r D. headers

Computer Science & Information Technology

?In the accompanying figure of a PowerPoint 2016 presentation, box _____ is pointing to the Decrease Font Size button.

A. ?C B. ?B C. ?D D. ?A

Computer Science & Information Technology