Operating System Process (PPT 2) Flashcards
What is a process?
It is a program in execution
What is a process made up of?
- Code
- Data, including the stack
- Operating Systems data structures
What are the six process states that can occur?
- New
- Ready
- Running
- Blocked
- Exit
- Suspend
Can a single process go through multiple states?
Yes, it can. You can build a history of the process from these states.
How many processes can have the Running state at one time (single core system)?
Only one process can have the Running state. Once it times out, the process is moved from Running to Ready and the next process is allowed to go.
How can a process become Blocked?
A process can become blocked if it has to wait for anything, such as a keystroke. It is then moved to the blocked state and can only move back to the Ready state if the event it was waiting for occurs
What is the Suspend state?
Suspend allows the OS to remove a blocked process completely from memory, allowing a new process to be started or return an old process back into memory. This occurs over and above the normal Virtual Memory operation.
Why would the OS need two suspend states?
It may need two suspend states, one for Ready suspend and one for Blocked suspend, because it allows the OS to avoid bring a suspended process back into memory just to know if it is still blocked. A process can move from Blocked suspend to Ready suspend once it is no longer blocked, allowing for it to be brought back in.
What is a Process Image?
This is what the process consists of while it sits in memory. It is a snapshot of its state at any given time
What does a Process Image Contain?
- User Data
- User Program Code
- System Stack
- Process Control Block (PCB)
What is a Process Control Block?
It is a data structure which contains all the necessary information which allows the scheduling of a particular process
What does a PCB contain?
- Process ID
- Processor State Information (CPU registers, stack pointers)
- Processor Control Information:
- processor state, priority, scheduling info, event
- data structures, inter-process communication
- privileges, memory management, resource ownership
What is Process Switching?
Taking one process off the CPU and putting another one onto the CPU. Process switch may occur when the OS has control of the CPU. There are three ways to do this:
- External Interrupt
- Trap
- Supervisor/System call
What is the Context?
Any information about the state of one process that would be changed by the execution of another process
What is Context Switching?
Changing the context which the CPU is using