wisconsin
Chapter 8: Exceptional Control Flow

Chapter 8: Exceptional Control Flow

Content locked

The catalog is public. Reading this content requires approved access.

Sign in to read
Chapter 8: Exceptional Control Flow
Exceptional Control Flow
8.1 Exceptions
Aside Hardware versus software exceptions
8.1.1 Exception Handling
8.1.2 Classes of Exceptions
Interrupts
Traps and System Calls
Faults
Aborts
8.1.3 Exceptions in Linux/x86-64 Systems
Linux/x86-64 Faults and Aborts
Linux/x86-64 System Calls
Aside A note on terminology
8.2 Processes
8.2.1 Logical Control Flow
8.2.2 Concurrent Flows
Practice Problem 8.1 (solution page 831)
8.2.3 Private Address Space
8.2.4 User and Kernel Modes
8.2.5 Context Switches
8.3 System Call Error Handling
8.4 Process Control
8.4.1 Obtaining Process IDs
8.4.2 Creating and Terminating Processes
8.4.3 Reaping Child Processes
Aside Why are terminated children called zombies?
Determining the Members of the Wait Set
Modifying the Default Behavior
Checking the Exit Status of a Reaped Child
Error Conditions
Practice Problem 8.3 (solution page 833)
The wait Function
Examples of Using waitpid
Aside Constants associated with Unix functions
Practice Problem 8.4 (solution page 833)
8.4.4 Putting Processes to Sleep
Practice Problem 8.5 (solution page 833)
8.4.5 Loading and Running Programs
Practice Problem 8.6 (solution page 833)
8.4.6 Using fork and execve to Run Programs
Aside Programs versus processes
8.5 Signals
8.5.1 Signal Terminology
8.5.2 Sending Signals
Process Groups
Sending Signals with the /bin/kill Program
Sending Signals from the Keyboard
Sending Signals with the kill Function
8.5.3 Receiving Signals
Practice Problem 8.7 (solution page 834)
8.5.4 Blocking and Unblocking Signals
8.5.5 Writing Signal Handlers
Safe Signal Handling
Correct Signal Handling
Practice Problem 8.8 (solution page 835)
Portable Signal Handling
8.5.6 Synchronizing Flows to Avoid Nasty Concurrency Bugs
8.5.7 Explicitly Waiting for Signals
8.6 Nonlocal Jumps
Aside Software exceptions in C++ and Java
8.7 Tools for Manipulating Processes
8.8 Summary
Bibliographic Notes
8.9 ◆
8.10 ◆
8.11 ◆
8.13 ◆
8.14 ◆
8.15 ◆
8.16 ◆
8.17 ◆
8.18 ◆◆
8.19 ◆◆
8.20 ◆◆
8.21 ◆◆
8.22 ◆◆◆
8.23 ◆◆
8.24 ◆◆◆
8.25 ◆◆◆
8.26 ◆◆◆◆
Solutions to Practice Problems
Solution to Problem 8.1 (page 770)
Solution to Problem 8.2 (page 779)
Solution to Problem 8.3 (page 781)
Solution to Problem 8.4 (page 784)
Solution to Problem 8.7 (page 800)
Solution to Problem 8.8 (page 809)
Source footnotes