Coder Social home page Coder Social logo

chaos-scheduler's Introduction

chaos-scheduler โ˜€๐ŸŒงโšกโ›… vs. ๐Ÿ’ปโœจ

The chaos scheduler is a non-preemptive priority-based scheduling algorithm which does unexpected things. It has four modes: Random, Weather - Static, Weather - Variable, and Shortest Job First. The goal here is to experiment, possibly with terrible ideas.

Definitions

  • Random: threads are prioritized... at pseudo-random
  • Weather - Static: threads are prioritized based on a static latitude/longitude (Boston)
  • Weather - Variable: threads are prioritized based on the weather at a generated latitude/longitude. The coordinates are generated based off of the thread id
  • Shortest Job First: threads are prioritized based on what should be the shortest running thread

Work

Note: no real work is done here - these threads are executing a difficult job of sleeping for a pseudo-randomly generated period of nanoseconds

Running

-r    random mode               | bool  default: true
-w    weather mode (static)     | bool  default: true
-v    weather mode (variable)   | bool  default: true
-j    shortest-job-first mode   | bool  default: true
-t    set size of threadpool    | int   default: 5
-n    number of threads created | int   default: 10

Examples:

chaos-scheduler                     | runs all modes, default threadpool size
chaos-scheduler -w=false -t=100     | does not run weather mode, 100 threads in pool

Weather calculation

The weather-based priority factor is calculated as follows:

priority = (temp / pressure) * (wind_gust + precip_total)

This roughly favors stronger weather (especially in warmer temperatures), as precipitation is more probable in areas with lower pressure. Note - this little calculation would breakdown with division by zero if you were checking a weather station near the edge of the atmosphere. As of 2017, this is not a problem we face yet :)

chaos-scheduler's People

Contributors

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