Giter Club home page Giter Club logo

scheduler's Introduction

CPU Scheduler

COEN346 - Operating Systems - Assignment 2 - CPU Scheduler

A CPU Scheduler that simulates process scheduling using Windows threads.

Requirements

The goal of this assignment is to successfully create a CPU scheduler that will be preemptive and priority-based. The processes are simulated using threads and the scheduler itself must be able to control the state of these threads. Time slots are given to each thread based on their priorities. This priority is also dynamic based on if two time slots were given previously. For this reason, we used Windows threads because we were able to suspend them if needed and even create them in a suspended state. The preemptive nature of the scheduler will make it so a currently running process can be interrupted by another one. Also, the program should read the instructions from a local file (ifstream) and write the output in a specified format to a text file (ofstream).

Results

There were many issue that arose when trying to create the scheduler. One of the more prominent issues was using threads to simulate processes. Since we were using threads that were actually controlled under the hood by the OS instead of our scheduler, the timings would be off by a couple of milliseconds. There is also the issue where a process has completed its burst time but has been suspended by our scheduler before it had a chance to notify the scheduler of its completion. There was also a big issue which needed to be solved that involved calculating the amount of time a thread has been running. The calculations of the running time were done in the thread since the scheduler doesn’t know exactly how long a process will take to complete. The problem with doing it this way is that when we suspend the thread it can no longer update its counters properly since it's using real life time that always increments whether or not a thread is suspended. In order to solve this we used the total wait time of the thread to help with this calculation.

scheduler's People

Contributors

gabbell avatar simon-bourque avatar

Stargazers

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