06-Processes

06-Processes - CSE 265: System and Network Administration...

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

View Full Document Right Arrow Icon
Spring 2006 CSE 265: System and Network Administration ©2006 Brian D. Davison CSE 265: CSE 265: System and Network Administration System and Network Administration Controlling Processes Components of a process Life cycle of a process Signals Send signals using kill and killall Process states Influence scheduling priority with nice and renice Monitor processes with ps and top Runaway processes
Background image of page 1

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

View Full DocumentRight Arrow Icon
Spring 2006 CSE 265: System and Network Administration ©2006 Brian D. Davison Components of a process Components of a process A process is the instantiation of a program From the kernel's perspective, a process is: An address space (the set of memory pages with code, libraries, and data) Set of data structures (within the kernel) The process's address space map Current status Execution priority Resources used Signal mask (which signals are blocked) The owner Which instructions are currently being executed
Background image of page 2
Spring 2006 CSE 265: System and Network Administration ©2006 Brian D. Davison Process attributes Process attributes Process ID – PID Unique identifier, wraps around Parent PID – PPID When a process is cloned, there is a parent and a child Real and effective user ID – UID and EUID EUID is used to determine what permissions the process has Also records original EUID (saved UID) Can be re-accessed later in program (even after changing EUID) Real and effective group ID – GID and EGID Niceness The CPU time available depends on its scheduling priority Users can make their processes 'nicer' to the rest of the system
Background image of page 3

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

View Full DocumentRight Arrow Icon
Spring 2006 CSE 265: System and Network Administration ©2006 Brian D. Davison Process life cycle Process life cycle An existing process calls fork(2) Parent is told PID of child Child is told 0 Child can use exec (or similar) to start a new program When ready to die, process calls _exit(2) with exit code Process becomes a zombie Parent must wait(2) to collect status of dead children Resource usage, why killed Orphans are re-mapped to init
Background image of page 4
Spring 2006 CSE 265: System and Network Administration ©2006 Brian D. Davison Signals Signals Signals are process-level interrupt requests Uses Inter-process communication Terminal driver can kill, interrupt or suspend processes (Ctrl-C, Ctrl-Z) Can be sent by admin (with kill) for various purposes Can be sent by kernel when process breaks a rule e.g., division by zero
Background image of page 5

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

View Full DocumentRight Arrow Icon
CSE 265: System and Network Administration ©2006 Brian D. Davison Handling signals Handling signals Process can designate a signal handler for a particular signal If no handler, kernel takes some default action When handler is finished catching signal, execution continues where the signal was received Process can request that particular signals be ignored, or blocked
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 21

06-Processes - CSE 265: System and Network Administration...

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

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