Code Monkey home page Code Monkey logo

cpu-scheduling-simulation's Introduction

Windows

CPU Scheduling Simulation

CPU scheduling is used to determine which process or task must be done first when many process are waiting to be completed. In this project I have created a simulation of these three algorithms to understand them more easier.

CPU use may algorithms such as

  • First Come First Served(FCFS)
  • Shortest Job First(SJF)
  • Round robin

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). These algorithms are designed to reduce waiting time and ensure that the CPU is continuously executing processes without being idle.

FCFS

The first process which come will be processed by the CPU before processing the next process.

SJF

The process which have least time of execution will be processed first.

Round Robin

The process is processed in multiple steps hence giving an equal chance to all processes. This is the most efficient algorithm for cpu scheduling

Install with pip

You can easily install the simulations of these three algorithms using pip. The name of the package is CpuSchedulingSimulation and the module used is Cpu_scheduling_algorithms. You can find the documentation here

pip install CpuSchedulingSimulation

Note: This will also install pygame(version 2.1.2)

Examples

Then just import the package and run the functions named as algorithms to see the simulation in action.

import Cpu_scheduling_algorithms as css
css.FCFS()
css.SJF()
css.Round_Robin()

Cloning the repo

Use the following command to clone the repo to your local system.

git clone https://github.com/harisankar01/CPU-Scheduling-Simulation.git

Then go into the folder to execute the functions.

cd CPU-Scheduling-Simulation

Packages used

Pygame a popular game library in pyton is used in this project to create simulation of the scheduling process

pip install pygame

Then finally run the main file which is FCFS.py and understand CPU scheduling easily.

python3 FCFS.py

Note: These simulations can be used to understand CPU scheduling effectively, if you have basic knowledge of CPU scheduling algorithms

Images

Screenshot (23) Screenshot (26) Screenshot (28)

cpu-scheduling-simulation's People

Contributors

harisankar01 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.