0% found this document useful (0 votes)
15 views

Process Management

Operation system/process management complete notes

Uploaded by

misbasaiyed075
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Process Management

Operation system/process management complete notes

Uploaded by

misbasaiyed075
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Process management

1). Job scheduler:


A Job Scheduler is a crucial component of Process Management in operating systems. Here's
how it works:

*Job Scheduler:*

- A Job Scheduler is responsible for selecting the next job (process) to be executed by the CPU.
- It manages the job queue, a list of jobs waiting for execution.
- The scheduler allocates CPU time to jobs based on a scheduling algorithm.

*Scheduling Algorithms:*

1. *First-Come-First-Served (FCFS)*: Executes jobs in the order they arrive.


2. *Shortest Job First (SJF)*: Executes the shortest job first.
3. *Priority Scheduling*: Executes jobs based on priority.
4. *Round-Robin (RR)*: Allocates fixed time slices (time quanta) to each job.

*Job Scheduler Functions:*

1. *Job Selection*: Selects the next job from the job queue.
2. *CPU Allocation*: Allocates the CPU to the selected job.
3. *Job Execution*: Executes the job until completion or time-out.
4. *Job Termination*: Terminates the job and deallocates CPU resources.
5. *Job Queue Management*: Manages the job queue, adding and removing jobs.

*Goals:*

1. *Efficiency*: Maximize CPU utilization.


2. *Fairness*: Ensure fair allocation of CPU time to jobs.
3. *Response Time*: Minimize response time for jobs.
4. *Throughput*: Maximize number of jobs executed per unit time.

The Job Scheduler plays a vital role in ensuring efficient and fair allocation of CPU resources to
jobs, making it a critical component of Process Management in operating systems.

1). Process scheduler:

_Process Scheduler:_

- Selects the next process to run on the CPU


- Allocates CPU time to processes based on scheduling algorithms (e.g., FCFS, SJF, Priority,
Round-Robin, Multilevel Queue)
- Manages process state transitions (ready, running, waiting, terminated)

_Goals:_
- Maximize CPU utilization
- Minimize response time
- Ensure fairness and priority
- Optimize system performance

_Functions:_

- Process selection
- CPU allocation
- Context switching
- Process state management

In short, the Process Scheduler efficiently allocates CPU resources to processes, ensuring
optimal system performance and fairness!

2). Job and Process Status:

*Job Status:*

1. *Submitted*: Job is submitted to the system.


2. *Waiting*: Job is waiting in the job queue for execution.
3. *Running*: Job is currently being executed by the CPU.
4. *Completed*: Job has finished execution.
5. *Failed*: Job has terminated due to an error.

*Process Status:*

1. *Newborn*: Process is created and initialized.


2. *Ready*: Process is waiting for CPU allocation.
3. *Running*: Process is currently executing on the CPU.
4. *Waiting*: Process is waiting for I/O or event completion.
5. *Sleeping*: Process is waiting for a specific event or time.
6. *Zombie*: Process has finished execution but still has an entry in the process table.
7. *Dead*: Process has been terminated and removed from the process table.

These statuses help the operating system manage and track the progress of jobs and
processes, ensuring efficient resource allocation and system performance.

3). Process control block:


A Process Control Block (PCB) is a data structure used by the operating system to manage and
control processes. It contains vital information about each process, allowing the OS to track and
manage process execution.

_Contents of a PCB:_

1. _Process ID (PID)_: Unique identifier for the process.


2. _Process State_: Current state (ready, running, waiting, etc.).
3. _Program Counter (PC)_: Address of the next instruction to be executed.
4. _Registers_: Saved register values (e.g., accumulator, index registers).
5. _Memory Management_: Information about memory allocation (base, limit, etc.).
6. _Open Files_: List of files currently opened by the process.
7. _I/O Devices_: List of I/O devices allocated to the process.
8. _Priority_: Process priority level.
9. _Scheduling Information_: Scheduling algorithm-specific data.
10. _Accounting Information_: Resource usage statistics (CPU time, memory, etc.).

_Purpose of a PCB:_

1. Process identification and management.


2. Context switching (saving and restoring process state).
3. Process synchronization and communication.
4. Resource allocation and management.
5. Scheduling and prioritization.

In summary, the PCB is a critical data structure that enables the operating system to effectively
manage and control processes, ensuring efficient and secure execution!

4). Process scheduling policies:


Process Scheduling Policies determine how processes are allocated CPU time. Here are some
common policies:

1. *First-Come-First-Served (FCFS)*: Execute processes in the order they arrive.

2. *Shortest Job First (SJF)*: Execute the shortest process first.

3. *Priority Scheduling*: Assign priorities to processes and execute the highest-priority process
first.

4. *Round-Robin (RR)*: Allocate fixed time slices (time quanta) to each process.

5. *Multilevel Queue*: Divide processes into multiple queues based on priority and allocate CPU
time accordingly.

6. *Multilevel Feedback Queue*: Dynamically adjust process priorities based on execution


history.

7. *Shortest Remaining Time First (SRTF)*: Execute the process with the shortest remaining
time.

8. *Longest Job First (LJF)*: Execute the longest process first.

9. *Rate Monotonic Scheduling (RMS)*: Allocate CPU time based on process periods and
deadlines.

10. *Earliest Deadline First (EDF)*: Execute the process with the earliest deadline.
These policies aim to optimize CPU utilization, minimize response time, and ensure fairness and
priority. The choice of policy depends on system goals, process characteristics, and
performance requirements.

You might also like