Overview

In our previous readings, we learned about the various classes of exceptions. While many of these are beyond the control of the programmer, they (and operating system) may send interrupts programmatically using Linux signals.

In this reading you’ll learn about how signals are handled and how a programmer can send signals. This will be useful in notifying other processes of certain events so that they may take a specific action.

Required Reading

Sections 8.5.0 - 8.5.4 (pp. 756-765) from the course textbook.

Learning Objectives

BASIC Learning Objectives

Each student will be responsible for learning and demonstrating proficiency in the following objectives PRIOR to the class meeting. The reading quiz will test these objectives.

  1. Given an event, determine the corresponding signal name and number that will be sent.
  2. Describe how the list of signals that need to be handled is maintained by the kernel.
  3. Compare and contrast the four ways in which signals can be sent.
  4. Describe the process by which signals are received and the correct signal handler is chosen/executed.

ADVANCED Learning Objectives

The following objectives should be mastered by each student DURING and FOLLOWING the class session through active work and practice.

  1. Write, read, and trace C code that sends signals to processes using the signal and kill functions.
  2. Given a C program and a specific line, determine which signals are blocked when that line of code is being executed.

Pre-class Exercises

These exercises are geared towards mastering the BASIC learning objectives listed above. You are expected to submit them before class and it is highly recommended that you complete them before attempting the reading quiz.

  1. For each of the following signals, describe (in your own words) their associated event.

  2. How does the kernel keep track of which signals are pending in a given process?

  3. How does the /bin/kill program compare to the kill system call?

  4. In your own words, summarize what happens when a process receives a signal.