Coder Social home page Coder Social logo

cpu-sheduling's Introduction

CPU Scheduling Algorithms

image

This GitHub repository contains Python implementations of various CPU scheduling algorithms. The current implementation includes the First Come First Serve (FCFS) algorithm.

First Come First Serve (FCFS)

Introduction

FCFS is a non-preemptive scheduling algorithm that schedules processes based on their arrival time. The process that arrives first is the first to be executed.

Implementation

The CpuScheduling class is used to represent the CPU scheduling algorithms. The FCFS algorithm is implemented in the fcfs method.

current implementaion can handle arrival time(s) with same value and can detect any halts

Usage

To use the FCFS algorithm with a specific set of processes, arrival times, and burst times, create an instance of the CpuScheduling class and call the fcfs method.

prcs = ["P1", "P2", "P3", "P4", "P5"]  # process
at = [0, 1, 2, 3, 4]  # arrival time
bt = [8, 1, 3, 2, 6]  # burst time
schedule = CpuScheduling(prcs, at, bt)
schedule.fcfs()

Output

image

The FCFS algorithm will display the order of process execution, completion time, turn around time, and waiting time in a tabular format.

Feel free to explore other CPU scheduling algorithms by extending the CpuScheduling class and implementing additional methods for Shortest Job First (SJF), Shortest Remaining Time First (SRTF), and Round Robin (RR) algorithms.

Happy coding!

cpu-sheduling's People

Contributors

coderatul avatar

Stargazers

 avatar

Watchers

 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.