Git Product home page Git Product logo

csc-377-project's Introduction

Process Management Simulation

Members: Zachary Polikarpus, Jordan VanDusen, Nickxit Bhardwaj

Building

Requires make of some sort, g++, and a POSIX environment. On Windows, the Linux subsytem will do. To build without running, make the default target

$ make

To build and run with the example set of programs, make the run target

$ make run

Running

The program accepts one necessary and one optional command line argument. The necessary first argument is the name of the initial program file to simulate. The optional second argument is a flag that prevents the program from sleeping for a second between input symbols (as dictated by the specification).

$ bin/simulate <program> [-f]

Once the program starts, the symbols read from STDIN control the flow of the simulation. In order to facilitiate efficient testing, unrecognized symbols (such as a line-feed character) are quietly ignored.

Recognized symbols are:

  • Q: Advance the state of the simulation
  • U: Unblock the first process on the "blocked" queue
  • P: Print the current state of the simulation
  • T: Terminate the simulation

Please note that, due to the specification's insistence that the "manager process" had to receive communications from the "commander process" via a pipe, there is no way for the manager process to inform the commander process that it has completed successfully. Therefore, the commander process must be terminated by sending an EOF (ctrl-D in a POSIX shell) after terminating the manager process with a T. Alternatively, a file of commands can be piped to STDIN; in which case the EOF is sent when the end of the input file is reached.

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.