cs2042_Lecture4 - CS2042 - Unix Tools Lecture 4 Jobs and...

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

View Full Document Right Arrow Icon
CS2042 - Unix Tools Lecture 4 Jobs and Processes Fall 2009 David Slater October 4th, 2009 David Slater CS2042 - Unix Tools
Background image of page 1

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

View Full DocumentRight Arrow Icon
Reminder Homework 1 is due tonight at 11:59PM Homework 2 will be posted Wednesday David Slater CS2042 - Unix Tools
Background image of page 2
Process? What Process? Definition A process is an instance of a running program More specific than ”a program” because it’s being executed. More specific than ”a running program” because the same program can be run multiple times simultaneously Example: Many users could be simultaneously running ssh to conect to other servers. In this case, each instance of ssh is a seperate process. David Slater CS2042 - Unix Tools
Background image of page 3

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

View Full DocumentRight Arrow Icon
Process Identification How do we tell one process from another? Each process is assigned a unique ”Process ID” (or PID) when it is created These PIDs are used to differentiate betewen separate instances of the same program How do we find out which processes are running, and with which PIDs? The P rocess S napshot Command ps [options] Reports a snapshot of the current running processes, including PIDs David Slater CS2042 - Unix Tools
Background image of page 4
By default, ps is not all that useful because it only lists processes started by the user in the current terminal. Instead. .. ps Options ps -e – Lists every process currently running on the system ps -ely – Gives more info about your processes than you’ll ever need ps -u username – Lists all processes for user username. NOTE: Options for BSD verison are different! (See manpage) David Slater CS2042 - Unix Tools
Background image of page 5

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

View Full DocumentRight Arrow Icon
Priority Suppose you want to run some long running scientific calculation that might take days and comsume 100% of the CPU on some server. Wouldn’t it be nice if there was some way to tell the server to give your process less priority with CPU time? Remember that although UNIX seems to run tens or hundreds of proceses at once, one CPU can only run one process at a time. Quick switching back and forth between processes makes it seem as though they are all running simultaneously UNIX Developers saw this type of situation coming - each process is given a priority value when it starts. David Slater CS2042 - Unix Tools
Background image of page 6
Initial Priority Start a process with a non-default priority: The nice command nice [options] command Runs command with a specified ”niceness value” (default: 10) Niceness values range from -20 (highest priority) and 19 (lowest priority) Only root can give a process a negative niceness value! Commands run without nice have priority 0.
Background image of page 7

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

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

Page1 / 29

cs2042_Lecture4 - CS2042 - Unix Tools Lecture 4 Jobs and...

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

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