Git Product home page Git Product logo

szte-os-scheduling's Introduction

Process Scheduling algorithm simulation

I measure various aspects of different process schedulers found in operating systems with this simulation. These processes have a blocking I/O operations that also take some time to complete. Everything is mesured in CPU ticks, or with a simple integer counter for the numer of context switches.

I implement the

  • Scheduling algorithms, of which these are done
    • First Come First Serve
    • Shortest Job Remaining
    • Round Robin
    • Smart Round Robin
    • Lottery
  • Methods to generate the processes and their blocking I/O operations probablistically to feed it into the simulator
  • Reporting system that gives insights into the result of the simulation, with data like
    • context switches (per process and sum)
    • wait time (idle ticks) per process and average
    • turn around time
    • CPU utilization

What you need to run it

  • the go toolchain (I specified 1.21.1, but try modifying the go.mod file to your version if you can't run it)
  • GNU make (optional)

How to run it TLDR

The default process generation and simulation, with no parameterization can be run simply like this

make

How to use it

There are 2 executables. One for producing the input, one for running the simulation and reporting the results in an html file.

See available algorithms with:

go run cmd/simulate/main.go --help

For generating the processes and the I/O operations associated with them, see the options with:

go run cmd/proc-gen/main.go --help

You can use these two execuatbles together with some basic command piping to make them work well with each other. They are only separated in case you want to generate your own input.json file (name does not matter, but the format is JSON).

go run cmd/proc-gen/main.go | go run cmd/simulate/main.go

Take a look at the run-example target of the Makefile.

Everything writes and reads from standard input and standard output. Only the report is guarenteed to be generated into a output.html. If you want to keep the generated json input, one way is to do this:

go run cmd/proc-gen/main.go | tee input.json | go run cmd/simulate/main.go

Or with two steps like so:

go run cmd/proc-gen/main.go > input.json 
go run cmd/simulate/main.go < input.json

There is an input.json in the root of this repository for you to use.

szte-os-scheduling's People

Contributors

hajagosnorbert 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.