Process and CPU Scheduling Flashcards
Process Concept
When a program is added to the memory and executed the same, it becomes a process which performs all the task mentioned by the program.
Components of Process
- Stack
- Heap
- Data
- Text
Process State
The state of the process is defined in part by the current activity of that process.
5 states- New, Ready, Running, Waiting, Terminated
Process Control Block
A process control block of a computer operating system stores all the information about the process.
Attributes of Process Control Block
- Process ID
- Process State
- Program counter
- CPU-scheduling information
- Memory-management information
- Accounting information
- I/O status information
- CPU registers
Thread
A thread is a basic unit of CPU utilization and is a single sequential flow of tasks of a process.
Types of Thread
- User-level Thread
- Kernel-level Thread
Components of Thread
- Program Counter
- Register Set
- Stack Space
Multithreading Models
- Many-to-one relationship
- One-to-one relationship
- Many-to-many relationship
Process Scheduling
The act of determining which process is in ready state, and should be moved to running state is known as Process Scheduling.
Scheduling Queues
- Job Queue - Consists all the process in the system.
- Ready Queue - This queue keeps a set of all processes residing in main memory, ready and waiting to execute.
Schedulers
These are the special system software which handle process scheduling in many ways.
Types of Schedulers
- Long-term - A balanced mix of jobs, such as I/O bound and processor bound.
- Short-term - To increase system performance in accordance with chosen set of criteria.
- Medium-term - In-charge of handling the swapped-out processes.
Context Switch
It is a mechanism to store and restore the context of a CPU in a process control block so that process execution can be resumed from the same point at a later time.
Pre-emptive Scheduling
The scheduling which takes place when a process switches from running state to ready state or from waiting state to ready state.