Docsity

Process - Operating Systems - Lecture Slides | CISC 361, Study notes of Operating Systems

Partial preview of the text

Download Process - Operating Systems - Lecture Slides | CISC 361 and more Study notes Operating Systems in PDF only on Docsity!

Processes

A process is a running program. The cpu can be used by one process while another is waiting on I/O. Multiprogramming โ€“ can switch from one program to another (interleave them). To user seems like more than one program running at a time on a single cpu. With a multiprocessor can run more than one at a time.

Processes

A process is an executing program with values for program counter, registers and variables. Also owns resources. Example: 3 processes A, B, C A B C Time

Process Switching

During a process switch the state of the current process must be saved. Then the new process can be given time on the cpu โ€“ context switch. The process that was taken off the cpu can be loaded back on some time later. Must save program counter, contents of registers, etc. to do so. Takes some amount of time.

Processes

OS Must have a way to create and terminate processes. Start off with initial process (init, pid 1). Then create more processes to form a tree. How to create a process

  • allocate resources
  • create process table entry fork(2), ps command, pid, parent pid

Process Hierarchy - SVR

0 - sched 1 - init inetd sshd tcsh Use ps and ptree commands

Process Termination

Normal voluntary exit Error voluntary exit involuntary fatal error killed by another process free up resources remove process table entry How many processes can a system support?