Presentation is loading. Please wait.

Presentation is loading. Please wait.

Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 1Winter Quarter UNIX Process Management.

Similar presentations


Presentation on theme: "Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 1Winter Quarter UNIX Process Management."— Presentation transcript:

1 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 1Winter Quarter UNIX Process Management and Control Lecture 16A

2 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 2Winter Quarter Processes in Modern-Day Operating System Multiple programs are loaded into memory and run to present the user with the operating system Other programs are run by the user to complete tasks (applications) Processes can be controlled manually by the user that owns them Processes can sometimes behave badly –Use more CPU/Memory than it should –In a shared system this takes away CPU/Memory from other users –A user can monitor and stop misbehaving processes

3 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 3Winter Quarter top – Table of Processes Allows anyone to see a list of processes running along with: –Process ID (PID) –Owner username –Memory Used –CPU Time –Current CPU Usage Command: “top” Initial Screen –All processes from all users

4 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 4Winter Quarter Viewing Only Your Processes top understands single-key commands –For a full list press “h” –To choose your user name press “u” Enter YOUR username and press Enter

5 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 5Winter Quarter Your Processes System Processes –KDE* (X Windows) –SSH (Secure Shell) Applications –MATLAB –bash (command prompt) –top (this program) –g??.out (your compiled programs)

6 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 6Winter Quarter Terminating a Process Occasionally a user loses access to a running process, but it is still running. –This wastes CPU and memory resources. –Users should terminate these “runaway” processes. Processes can be killed (terminated) directly within top and from a terminal window. Only kill processes you know should no longer be running. Randomly terminating system processes can make your environment unstable! You can only terminate your own processes.

7 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 7Winter Quarter Killing a Process from Within top MATLAB application window closed, but is still running on the system –Program has used nearly 12 minutes of CPU time –Kill a process by pressing “k”

8 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 8Winter Quarter Killing a Process from within top Enter the Process ID (PID) and press Enter

9 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 9Winter Quarter Killing a Process from within top Processes can be killed with multiple “signals” –Tells the process how to terminate –Most common: 15 – Terminate as if program closed normally 9 – Terminate immediately (forced quit) –For a list: “kill -l” at a terminal prompt (The letter l not the number 1, and not within top) In top: press Enter for 15 [default] or enter another signal number and press Enter

10 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 10Winter Quarter Killing a Process from within top The process should disappear from the list –If it does not disappear with signal 15, try signal 9 –If signal 9 doesn’t work (in rare cases), an administrator will have to terminate the process for you To exit top: press “q”

11 Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 11Winter Quarter Killing a Process from the Command Line List processes: “ps –u ” Kill a process: “kill –s ” Kill all by name: “killall ”


Download ppt "Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 16AP. 1Winter Quarter UNIX Process Management."

Similar presentations


Ads by Google