17 Process Control

17 Process Control - !"#"$% CMSC 216 Introduction to...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
!"#"$$ $ CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O Jan Plane & Pete Keleher {jplane,[email protected] Administrivia • Project 4 issues – Due date: Sun, 10 Apr at 06:00 PM • Exam statistics – Approx 70% with standard deviation of 16 – High 97 – >= 85 is the top 20 percentile – >= 75 is the top 40 percentile – <= 56 is the bottom 20 percentile CMSC 216 - Wood, Sussman, Herman, Plane 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
!"#"$$ P ROCESS C ONTROL ( CONT .) Sections 8.2-8.5, Bryant and O'Hallaron CMSC 216 - Wood, Sussman, Herman, Plane 3 Tools for working with processes ps : UNIX command to see the current list of processes – several different options ( -e , -f , -p , -u , etc.) strace : Linux tool to print trace of all system calls a program and its children perform (precedes rest of command line) pgrep name : prints pids of processes with name in their command lines pkill name : sends a signal to all processes with name in the command lines kill pid-list : sends a signal to all specified processes top : display current info about system and processes Ctrl+Z, bg , fg , and : process backgrounding /proc : a (virtual) part of the filesystem on Linux that has all sorts of info on kernel data structures related to processes, and other OS related system info CMSC 216 - Wood, Sussman, Herman, Plane 4
Background image of page 2
!"#"$$ ' Signals • A message to a process to notify it of an event • Kernel notifies processes of many events: SIGSEGV : segmentation violation (aka segfault) SIGFPE : floating point exception SIGCHLD : child process stopped/terminated • Users can trigger sending of signals: SIGINT : interrupt (Ctrl-C) SIGQUIT : quit and dump core (Ctrl+\) SIGTSTP : terminal stop, (Ctrl+Z) CMSC 216 - Wood, Sussman, Herman, Plane 5 Signals, cont. • Processes can also send signals to each other (via the kernel) • Processes have default actions when receiving signals (sometimes ignore, sometimes quit) • There are mechanisms for processes to block signals, but two ( SIGKILL and SIGSTOP ) can't be blocked • Signals are sent with the kill UNIX command, or in a program using the kill() function – they do not always send the signal SIGKILL ! CMSC 216 - Wood, Sussman, Herman, Plane 6
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
!"#"$$ ! S YSTEM -L EVEL I/O Chapter 11, Bryant and O'Hallaron CMSC 216 - Wood, Sussman, Herman, Plane 7 UNIX file management • A file in UNIX is just a sequence of bytes • All I/O devices are modeled as files in UNIX – disks, network sockets, etc. • The kernel maintains a file descriptor table, holding information about all open files, for each process • File descriptors are nonnegative integers used by processes to access files in a process' table CMSC 216 - Wood, Sussman, Herman, Plane 8
Background image of page 4
!"#"$$ ( File operations • A process requests access to a file via an open() system call; the kernel returns a file descriptor • The process reads, writes, and moves around the file using the file descriptor and other
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/16/2011 for the course CMSC 216 taught by Professor Plane during the Spring '11 term at Maryland.

Page1 / 16

17 Process Control - !"#"$% CMSC 216 Introduction to...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online