Presentation is loading. Please wait.

Presentation is loading. Please wait.

Module 2.1 COP4600 – Operating Systems Richard Newman

Similar presentations


Presentation on theme: "Module 2.1 COP4600 – Operating Systems Richard Newman"— Presentation transcript:

1 Module 2.1 COP4600 – Operating Systems Richard Newman
Process Basics Module 2.1 COP4600 – Operating Systems Richard Newman

2 Process definition Algorithm = finite set of unambiguous instructions with finite initial storage and state, a specific starting instruction, and unambiguously determined next instruction and state at any point, except if the last instruction was halt. Often expressed with flow chart or pseudocode Program = sequence of instructions that embody an algorithm Source code → assembly code → machine code Process = program in execution = program + state May have many processes executing same program Process state = current instruction and state of memory, resources

3 pseudoparallelism Each process is given CPU in turn
PC and other registers hold state of the process that is running System switches from one program to another by suspending current program, swapping state of registers, then starting new program Figure 2-1. (a) Multiprogramming of four programs. Tanenbaum & Bos,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

4 The Process Model - sequential
Conceptually, each program has its own program counter Conceptually, each program runs independently of the others It is up to the system to see that the programs do not interfere with each other Figure 2-1. (b) Conceptual model of four independent, sequential processes. Tanenbaum & Bos,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

5 The Process Model – processor sharing
B A Process using CPU Time Figure 2-1. (c) Only one program is active at once. Tanenbaum & Bos,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

6 Process Creation Four principal events that cause processes to be created: System initialization. Execution of a process creation system call by a running process. A user request to create a new process. Initiation of a batch job. Tanenbaum & Bos,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

7 Process Termination Typical conditions which terminate a process:
Normal exit (voluntary). Error exit (voluntary). Fatal error (involuntary). Killed by another process (involuntary). Tanenbaum & Bos,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

8 Process States (1) States a process may be in:
Running (actually using the CPU at that instant). Ready (runnable; temporarily stopped to let another process run). Blocked (unable to run until some external event happens). Initializing (system preparing process to run). Exiting (system cleaning up after process terminates). Swapped out & Blocked (image not in RAM, waiting for event) Swapped out & Ready (image not in RAM, not waiting for event) Tanenbaum & Bos, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

9 Process States (2) Exiting Ready Running Blocked Initializing Swapped
Select & dispatch Initialized Ready Running Halt Swap in Preempt Swapped Out-R Swap out Unblock Blocked Block Swap in Swapped Out-B Unblock Swap out

10 Process States (3) Figure 2-3. The lowest layer of a process-structured operating system handles interrupts and scheduling. Above that layer are sequential processes. Tanenbaum & Bos,Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

11 Summary What is a process Processor sharing Process Life Cycle
Not the same as a program! Processor sharing Pseudoparallelism Process Life Cycle Process states and state transitions


Download ppt "Module 2.1 COP4600 – Operating Systems Richard Newman"

Similar presentations


Ads by Google