Processes1 Flashcards
What is a process?
When a program is executed and loaded into the memory. It is an active entity. A program may create multiple almost identical processes.
What is a program?
Passive entity (executable file) stored on HDD
What is process context?
A process contains text section (program code), current activity (process number, process state, program counter, value stored in registers, CPU related information, Accounting information and I/O status information), stack (temporary data), data section (global data that is shared between processes), heap (memory allocated).
What is a PCB?
Process Control Block. Each process has its own PCB. PCB contains the context information about a process.
What is a process Identification Number PID?
Process Identifier is the unique ID number to identify a process.
What are the different process states?
A process can be in 5 possible states: new (created), running (executed), waiting, ready (waiting to be assigned to CPU) and terminated (finished).
What is contained in the program counter?
The location of instruction that CPU needs to execute next.
Whats an idle process?
Process waiting for I/O to complete
What is context switching?
When CPU is switching from Process 0 to Process 1, CPU will first save the current state/context of Process 0 to Process 0’s PCB. It will then load the state/context of Process 1 from Process 1’s PCB.
What is a foreground process?
Process that is currently visible to the user and controlled via user interface.
What is a background process?
Process that is currently running in memory but are not on display.
How are processes created?
Process is created because of an execution of a system call, initiation of a batch job, a user request to create a new process and a running process create one or more new child processes.
what does the fork() system call do?
System call to create a new process
What does the exec() system call do?
System call to load a new program to the specified process
What are the resource sharing options for processes?
A child process may share all, subset or none of the parent’s resources. Usually a child process only share subset of the parent to prevent a process overloading the system with too many child processes.