Process Flashcards
Process
A process is basically a program in execution
Stack
Stack contains the temporary data such as method/function parameters, return address and local variables
Heap
This is dynamically allocated memory to a process during its run time
Text
This includes the current activity represented by the value of Program Counter and the contents of the processor’s registers
Data
This section contains the global and static variables
Process States
- New- The process is in new state when it has just been created.<.li>
- Ready - The process is waiting to be assigned the processor by the short term scheduler.<.li>
- Running - The process instructions are being executed by the processor.<.li>
- Waiting - The process is waiting for some event such as I/O to occur.<.li>
- Terminated - The process has completed its execution.<.li>
Process Control Block
A process control block is associated with each of the processes.
* Process State - This specifies the process state i.e. new, ready, running, waiting or terminated.
* Process Number - This shows the number of the particular process.
* Program Counter - This contains the address of the next instruction that needs to be executed in the process.
* Registers - This specifies the registers that are used by the process. They may include accumulators, index registers, stack pointers, general purpose registers etc.
* List of files - These are the different files that are associated with the process.
Long Term Scheduler
The job scheduler or long term scheduler selects processes from the storage pool and loads them into memory for execution.
Short Term Scheduler
The short term scheduler selects one of the processes from the ready queue and schedules them for execution
Medium Term Scheduler
The medium term scheduler swaps out a process from main memory
Context Switching
Removing a process from a CPU and scheduling another process requires saving the state of the old process and loading the state of the new process. This is known as context switching
- First-come, first-served (FCFS)
where the process is executed on a first-come, first-served basis
Preemptive scheduling
when a process transitions from a running state to a ready state or from a waiting state to a ready state.
- Shortest Job First (SJF
SJF is a proactive scheduling algorithm that selects the process with the shortest burst time.
Non-preemptive scheduling
Is employed when a process terminates or transitions from running to waiting state