Process Management: Processes Flashcards
A Process is the basic unit of execution in an operating system
Each process has a number, its process identifier (pid)
Different processes may run
different instances of the same program
Ex: my gcc and your gcc process both run c compiler
At a minimum,
process execution requires following resources:
Memory to contain the program code and data
A set of CPU registers to support execution
Modern OS run
multiple processes concurrently
Examples: (can all run simultaneously):
o gcc hello_world.c – compiler running on hello_world file
o gcc read_A.c – compiler running on read_A file
o emacs – text editor
o firefox – web browser
Steps of program to process:
when first we write the program in e.g C
then the compiler turns that program into an instruction list
OS delivers the instruction list to the processor
then The CPU interprets the instruction list
Process has its own address space:
.The program code, also called text section
. Current activity including program counter,
processor registers
. Stack containing temporary data
. Function parameters
. return addresses
. local variables
. Data section containing global variables
. Heap containing memory dynamically
allocated during run time
As a process executes, it changes state
. new: The process is being created
. running: Instructions are being executed
. waiting: The process is waiting for some event to occur
. ready: The process is waiting to be assigned to a processor
. terminated: the process has finished execution
Each process is represented in the operating system
by a process control block (PCB)
The goal of scheduling is to Maximize
CPU use, quickly switch processes onto CPU for time sharing