Process Managment Flashcards
What is a program?
A set of instructions for performing a task
What is a process?
A program in execution
What are the 5 process states?
Born, Ready, Waiting, Running, Died
What happens when a process is born?
A process is created but has not yet been admitted to the pool of executed processes
When is a process transferred to the ready state?
When the OS is ready for the process, or if another process is required.
Why does the processor transfer a process between ready and running?
A process is transferred based on a priority its assigned by the processor.
When is the waiting stage used?
When waiting for input from an I/O device or when the process has made a request it has to wait for.
When does a process die?
When it has been completed or aborted
What is a Process Control Block?
the PCB represents a process and is stored in memory or on disk.
What data does the Process Control Block Contain?
The process number/ID, the processes registers, the process address space, the process I/O.
What term is used to describe switching processes?
Context Switch or a Process Switch
How does a context switch take place?
Change Process Scheduling State of process A, save the context of process A (save variables form registers to memory), load context of process B, change Process Scheduling state of process B.
What is contained in the process address space?
Stack for temp data, heap for dynamically allocated data, data section for static data, text section for program code.
How and why is a Heap used?
Blocks of memory are allocated and removed in an arbitrary order of any required size. It is used to store a large block of memory for a longer period of time, and variables that can change size.
What interaction can happen between the Stack and the Heap?
As the stack and the heap grow they grow towards each other in memory, this means that if they aren’t properly controlled they can start to overwrite each other.