Code Monkey home page Code Monkey logo

process-simulator's Introduction

Process Simulator

CPU scheduling algorithm (FCFS, SJF, SRTF, Priority-based Scheduling , Preemptive Priority-based Scheduling, Round Robin) and deadlock avoidance algorithm (Banker’s Algorithm) are implemented in this project.

List of Commands

The following commands are working in my project.

Command Remarks
create-process Create a new process.
ready-process Transfer processes from job queue to ready queue and device queue. Also call the function bankers_algorithm() to check system is safe or not if there is any process in device queue.
show-job-queue Show all process in job queue.
show-ready-queue Show all process in ready queue.
show-device-queue Show all process in device queue.
execute-process Execute all process in ready queue, before that users have to select a scheduling algorithm to start execution.
reexecute-process Re-execute all process in ready queue including all terminated process.
change-status Switch state of a process to another state. There are five option to switch state of a process, user has to select an option, then also need to select a particular process. Enough frames must be available in memory to switch state of a process to ‘ready’ state. If state of a process switch to ‘waiting’ state bankers_algorithm() function will be called to check system is safe or not.
show-memory-map Display all frames in memory.
clear Clear the screen.
exit Terminate the process simulator

NB: As many functions depending on the data stored by the sysConfig(), it will be called automatically at the beginning of the program.

Data Structure used

I have used the data structure, Vector and also Queue in some cases, as given in the sample project.

CPU Scheduling Algorithms

The following CPU scheduling algorithms are implemented.

  • FCFS
  • SJF
  • SRTF
  • Priority-based Scheduling
  • Preemptive Priority-based Scheduling
  • Round Robin

Banker’s Algorithm for Deadlock Avoidance

This algorithm is implemented in my project. After executing this algorithm –

  • If the system is safe, safe sequence will be printed.
  • If the system is unsafe, one process will be preempted and banker’s algorithm will be called, if the system is still unsafe, another process will be preempted and again the banker’s algorithm will be called. This process will continue until the system is in the safe state.

Memory Management

  • Process will be sent to ready queue according to available frame number in memory.
  • Users can view which frame is allocated to which process and which frames are empty.

process-simulator's People

Contributors

shakil-mahmud avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

khalidkhelil

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.