You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CPU scheduling is used to determine which process or task must be done **first** when many
4
+
process are waiting to be completed. In this project I have created a simulation of these three algorithms to understand them more easier.
5
+
2
6
CPU use may algorithms such as
7
+
3
8
+ First Come First Served(FCFS)
4
9
+ Shortest Job First(SJF)
5
10
+ Round robin
6
11
7
-
These are used to schedule which process or task must be done **first** when many
8
-
process are waiting. In this project I have created a simulation of these three algorithms to understand them more easier.
9
-
12
+
Basically a process have a fixed execution time(time required to complete the process), waiting time(time the process has to wait to be processed).
13
+
These algorithms are designed to reduce waiting time and ensure that the CPU is continuously executing processes without being idle.
10
14
## FCFS
11
15
12
-
The fisrt process which come will be processed by the CPU before processing the next process.
16
+
The first process which come will be processed by the CPU before processing the next process.
13
17
14
18
## SJF
15
19
16
20
The process which have least time of execution will be processed first.
17
21
18
22
## Round Robin
19
23
20
-
The process is processed in multiple steps hence giving a equal chance to all processes
24
+
The process is processed in multiple steps hence giving an equal chance to all processes. This is the **most efficient** algorithm for cpu scheduling
21
25
22
26
# Install with pip
23
-
You can easily install this using pip,
27
+
You can easily install the simulations of these three algorithms using pip. The name of the package is **CpuSchedulingSimulation**
28
+
and the module used is **Cpu_scheduling_algorithms**. You can find the documentation [here](https://pypi.org/project/CpuSchedulingSimulation/#description)
29
+
24
30
```
25
-
pip install Cpu-scheduling-simulation
31
+
pip install CpuSchedulingSimulation
26
32
```
33
+
34
+
> Note: This will also install pygame(version 2.1.2)
35
+
27
36
## Examples
28
37
29
-
Then just import the package and run the functions named as algorithms to see the simulation in action
38
+
Then just import the package and run the functions named as algorithms to see the simulation in action.
30
39
```python
31
-
importCpuSchedulingSimulationas css
40
+
importCpu_scheduling_algorithmsas css
32
41
css.FCFS()
42
+
```
43
+
```python
33
44
css.SJF()
45
+
```
46
+
```python
34
47
css.Round_Robin()
35
48
```
36
49
37
50
38
-
# Packages used
51
+
# Cloning the repo
52
+
Use the following command to clone the repo to your local system.
0 commit comments