Git Product home page Git Product logo

process-scheduling's Introduction

Process-Scheduling

Process-Scheduling in collaboration with Aida Bumbu

Objective:

Simulate a simplified version of Linux 2.6 - 2.6.63 O(1) scheduler.

Description:

We consider a single processor system able to run 1 process at a time. This creates a wait line for other processes to be able to run. Processes each have their own proper priority.

The scheduler described:

  • The scheduler has 2 queues. 1 Queue flagged as the active queue, and the other queue flagged as the expired/dormant queue.

  • Whenever a new process joins, it is stored in the dormant queue.

  • Processes in the active queue may request the CPU.

  • Every process has its own PID, arrival time, CPU burst and priority.

  • Priorities range from 1 to 139.

  • Time quantums are assigned to processes based on the following equations:

    If priority < 100: Time Quantum = (140 - priority) * 20 (milliseconds). If priority >= 100: Time Quantum = (140 - priority) * 5 (milliseconds).

  • After a process's time quantum passes, it is moved from the active queue to the expired queue.

  • After the active queue is empty, switch the flag of the active queue to expired and the flag of the expired queue to active. Now, the previous expired queue becomes the active queue and the previous active queue becomes the expired queue.

  • Priorities are updated throughout the program based on the following relationships:

Waiting time = Sum of waiting_times of the process. bonus = ceiling(10 * waiting time/(current_time - arrival time)) New_priority = max(100, min((old_priority - bonus + 5) , 139))

The Program:

process-scheduling's People

Contributors

elie-kh avatar

Watchers

James Cloos 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.