Giter Club home page Giter Club logo

simulation-cpu-scheduling's Introduction

CPU Scheduling Simulation πŸ‘Ύ

CPU scheduling scheme:

  • 2 levels of a Ready-Queue: one for Real-Time processes and one for Common processes.

  • Each level practices round-robin.

  • Real-Time processes have priority. Run Common processes only if there are no Real-Time processes waiting to use the CPU. If a Real-Time process arrives while a Common process is running, the Common process will be preempted and sent to the head of the Common processes' Ready-Queue.

  • I/O-queues are First Come First Serve (FCFS).

  • Memory: Contiguous Memory Management with β€œfirst-fit” approach.

# start of the simulation prompt
How much RAM memory is there on the simulated computer? (Up to 4 billions).
How many hard disks does the simulated computer have? 

# After this, the simulation begins. 
# The program is constantly listening for user inputs. 
# Possible inputs are listed under Acceptable Commands

Acceptable Commands

  • A size β€˜A’ input means that a new common process has been created. When the new process arrives, your program should create its PCB and place the process in the ready-queue or the CPU. The requested amount of memory should be allocated for the new process. When choosing a PID for the new process start from 1 and go up. Do NOT reuse PIDs of the terminated processes. For example, the command A 1000 means that a new common process has been created and it requires 1000 bytes of memory.

  • AR size the same as β€˜A’ but the new process is an RT-process.

  • Q means that the time slice has ended for the currently running process.

  • t currently running process terminates

  • d number The process that currently uses the CPU requests the hard disk #number.

  • D number The hard disk #number has finished the work for one process.

  • S r Shows what process is currently using the CPU and what processes are waiting on both levels of the ready-queue.

  • S i Shows what processes are currently using the hard disks and what processes are waiting to use them. For each busy hard disk show the process that uses it and show its I/O-queue. The enumeration of hard disks starts from 0.

  • S m Shows the state of memory. Show the range of memory addresses used by each process in the system.

Run Locally:

  1. Clone repo.
  2. Navigate to the root directory of the project.
  3. Run make all to compile the program.
  4. Run ./Simulation to start the program.
  5. Follow the simulation's instructions to interact with the program! πŸŽ‰

April 2020

simulation-cpu-scheduling's People

Contributors

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