CMU CS 15213 - Recitation (7 pages)

Previewing pages 1, 2 of 7 page document View the full content.
View Full Document

Recitation



Previewing pages 1, 2 of actual document.

View the full content.
View Full Document
View Full Document

Recitation

129 views


Pages:
7
School:
Carnegie Mellon University
Course:
Cs 15213 - Introduction to Computer Systems
Introduction to Computer Systems Documents

Unformatted text preview:

Andrew Faulring Recitation 8 Signals Shells Andrew Faulring 15213 Section A 28 October 2002 faulring cs cmu edu Office hours NSH 2504 lab 2507 conference room Thursday 5 6 Lab 5 due Thursday 31 Oct 11 59pm Halloween Night happy reaping Today s Plan Process IDs Process Groups Process Control Signals Preemptive Scheduler Race hazards Reaping Child Processes Lab 5 Shell tshref Use as a guide for output You shell should have same behavior How Programmers Play with Processes Process executing copy of program Basic functions fork spawns new process exit terminates calling process wait and waitpid wait for and reap terminated children execl and execve run a new program in an existing process Process IDs Process Groups Each process has its own unique process ID pid t getpid Each process belongs to exactly one process group pid t getpgid To which process group does a new process initially belong Its parent s process group A process can make a process group for itself and its children setpgid 0 0 Signals pid 10 pgid 10 Section 8 5 in text Shell Read at least twice really pid 20 pgid 20 Background job 1 Foreground job Child Child pid 21 pgid 20 pid 22 pgid 20 Foreground process group 20 pid 32 pgid 32 Background process group 32 Background job 2 pid 40 pgid 40 Backgroud process group 40 A signal tells our program that some event has occurred For instance a child process has terminated Can we use signals to count events No Important Signals Sending a Signal SIGINT Send a signal SIGTSTP Why is a signal sent Interrupt signal from keyboard ctrl c Stop signal from keyboard ctrl z SIGCHLD A child process has stopped or terminated Sent by either the kernel Or another process The kernel detects a system event Divide by zero SIGFPE Termination of a child process SIGCHLD Another process invokes a system call kill pid t pid int SIGINT kill 1500 SIGINT Send SIGINT to process 1500 kill 1500 SIGINT Send SIGINT to progress group 1500 alarm unsigned int secs Look at Figure 8 23 for a complete



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Recitation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Recitation and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?