Skip to content

Commit 7da9acd

Browse files
README.md
1 parent 974b87a commit 7da9acd

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# [Scheduling Algorithms](https://github.com/PrakharPipersania/Scheduling-Algorithms)
2+
3+
![Language](https://img.shields.io/badge/Language-C-255fcc.svg) 
4+
[![License](https://img.shields.io/badge/License-MIT-orange.svg)](./LICENSE) 
5+
![Total Tests](https://img.shields.io/badge/Total%20Tests-58%20(All%20Passed)-purple.svg) 
6+
![Progress](https://img.shields.io/badge/Progress-100%25-brightgreen.svg) 
7+
8+
## Some Popular Process Scheduling Algorithms are:-
9+
* First Come First Served (FCFS) Scheduling
10+
* Shortest Job First (SJN) Scheduling
11+
* Priority Scheduling
12+
* Round Robin(RR) Scheduling
13+
* Highest Response Ratio Next(HRRN) Scheduling
14+
15+
### First Come First Served Scheduling:
16+
In this Algorithm, Process that request CPU first, CPU is allocated first to that process .i.e. the algorithm is known as first come, first served. It based on FIFO (First in First Out) queue data structure. When a process entered in the ready queue, its Process Control Block (PCB) is added to end of the Queue. When CPU gets free after a process execution, a new process from the head of the queue is removed and enters in running state.
17+
* Criteria: Arrival Time
18+
* Mode: Non-Preemptive
19+
* Convoy Effect OR Starvation (When the process with the highest burst time is first entertained by the CPU)
20+
21+
### Shortest Job First Scheduling:
22+
SJF is a preemptive and Non-Preemptive algorithm. It based on length of latter’s next CPU burst. If a process acquired CPU and execution is going on, a new process with small CPU burst entered. Then CPU is preempted from current process and will give to further process. If two processes have the same length next CPU burst, FCFS scheduling is used to break the tie. Shortest Next CPUburst is also an appropriate term for SJF algorithm because scheduler examines the length of next CPU burst continuously.
23+
* Criteria: Burst Time
24+
* Mode(Shortest Job First): Non-Preemptive
25+
* Mode(Shortest Remaining Time First ): Preemptive
26+
27+
### Priority Scheduling:
28+
SJF is a simple priority algorithm, where we are not considering the smallest next CPU burst, scheduler consider the priority of processes. The priority assigned to each process and CPU allocated to highest priority process. Equal priority processes scheduled in FCFS order. Priority can be discussed regarding Lower and higher priority.Numbers denote it.We can use 0 for lower priority as well as more top priority.There is not a hard and fast rule to assign numbers to preferences.
29+
* Criteria: Priority
30+
* Mode: Non-Preemptive OR Preemptive
31+
32+
### Round Robin Scheduling
33+
Round Robin Scheduling algorithm designed for time-sharing systems. It is similar to FCFS scheduling but adding preemption to switch the processes after a small unit of time. A small unit of time is called a time quantum. A time quantum might be from 10 to 100 millisecond.
34+
* How RR algorithm works: Ready queue as a FIFO queue. The new process will add to the tail of the ready queue and process is removed from the head of queue.CPU select a process from ready queue, set a timer. After completion of time quantum, the process will be preempted doesn’t matter it is completed or not. IF the process not finished it will add in the tail of the queue and CPU select new process. In this way, the process is going on.
35+
* Criteria: Time Quantum
36+
* Mode: Preemptive
37+
* No Starvation
38+
39+
### Highest Response Ratio Next Scheduling
40+
Highest Response Ratio Next (HRNN) is one of the most optimal scheduling algorithms. This is a non-preemptive algorithm in which, the scheduling is done on the basis of an extra parameter called Response Ratio. A Response Ratio is calculated for each of the available jobs and the Job with the highest response ratio is given priority over the others.
41+
* Criteria: Response Ratio
42+
* Mode: Non-Preemptive

0 commit comments

Comments
 (0)