Code Monkey home page Code Monkey logo

os_pqsh's Introduction

PQSH: Process Queue Scheduler

Overview

This project is developed as part of our Operating Systems course to simulate and test different process scheduling algorithms.

Features

Multiple Scheduling Policies: FIFO, Round Robin, and Shortest Job First (SJF).
Signal Handling: Custom signal registration and handling.
Timestamp Recording: Precise process timing and logging.
Debugging Utilities: Macros for logging and debugging.

Getting Started

Prerequisites:

  • GCC (GNU Compiler Collection)
  • Make : Building the Project

Building the project:

  1. clone the repository:
git clone https://github.com/yourusername/pqsh.git 
cd pqsh
  1. compile the project:
make

Running the Scheduler

To run the scheduler:

./bin/pqsh 

Testing the Scheduler

To run the test suite:

make test

This command will compile and execute the tests located in the tests/ directory.

Directory Structure

include/pq/: Header files defining the interface and structures for different components.
src/: Source files implementing the core functionality of PQSH.
tests/: Unit tests and scripts to validate the scheduler's functionality.
bin/: Compiled binaries of the scheduler and test programs.

Components

Scheduler

The scheduler component manages process queues and implements different scheduling policies:

FIFO (First In, First Out): Processes are scheduled in the order they arrive.
Round Robin: Processes are assigned a fixed time slice and scheduled in a cyclic order.
SJF (Shortest Job First): Processes with the shortest execution time are scheduled first.

The scheduler's structure includes queues for running, waiting, and finished processes. It tracks total turnaround and response times to evaluate scheduling performance.

Signal Handling

Signal handling in PQSH allows for the registration of custom signal handlers. This feature is critical for managing asynchronous events, such as process timeouts and interrupts. The signal handlers ensure that processes are properly started, paused, and resumed based on system signals.

Timestamp Recording

Timestamp utilities provide precise measurements of process start, stop, and duration times. This feature is essential for performance analysis and debugging, allowing for accurate tracking of process execution timelines.

Code Implementation

timestamp: Declares the function for recording timestamps.

signal: Defines signal handling functions and handlers.

scheduler: Declares the scheduler structure, policies, and related functions.

queue: Defines the queue structure and functions for queue operations.

process: Declares the process structure and functions for process management.

options: Declares functions for parsing command-line options.

macros: Defines macros for logging and utility functions.

Testing

The tests/ directory contains unit tests and scripts to validate the functionality of the scheduler.
The tests ensure that each component works correctly and that the scheduling policies produce the expected results.

Example result

Alt Alt

os_pqsh's People

Contributors

wloerakving avatar rozahamidi avatar pbui 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.