Coder Social home page Coder Social logo

pintos's People

Contributors

rickyyx avatar

Stargazers

 avatar

pintos's Issues

Priority Scheduling

  • thread_create() should set default priority
  • handle (multiple/nested) donations to prevent priority inversion for locks.
  • preemption on being runnable (wakeup, sleep over
  • higher task wake up from block first, and sleep list
  • setting of priority could trigger preemption
  • ready_list to be sorted
  • donations
  • set priority
  • get priority
  • static_priority to keep track of non-donated priority

Alternative:
array of List to record priority of each thread?

  • max_runnable_priority to keep track of which list to pop?
  • Random access to threads with specific priority

runnable list sorted by priority?

Donations:

  • On lock_acquire():
    • T donates its priority to the lock holder (if the holder is blocked?)
    • Nested donation:
      • how to find out if the lock holder is locked?

      thread needs to maintain information of the lock it is waiting for? Like, lock_waiting

  • On lock_release():
    • Restores its original priority && have the highest priority thread woke up
  • sema_up() needs to wake up the highest priority waiting thread.

Project 2

To Do:

Minimal user program

  • Argument passing
    bd39746
  • User memory access
  • System call infra
  • exit syscall
  • write syscall
  • process_wait stud

wait():

  1. parent exits earlier than child
  2. child exits before parent calls wait() -> ZOMBIE

Project 3

TODOs:

Frame Table:

Data structures:

  • (hash-map<void* frame, void* page> ? Or use a struct inclusive of void* page )

  • Use list of frame struct (Since no quick lookup needed)

  • Obtain a frame

  • Frame eviction

Advanced Schedule

TODO:

  • init a thread with correct recent_cpu
  • init with correct load
  • init thread with correct priority
  • calcualte_priority

Data structure for the MLFQ

  • [NUM_PRI] queues?
    -> array of lists?
    -> a rq_status 64 bits number.

For thread_tick():

  • At each second:
    update_load_avg()
    update_all_recent_cpu()

  • At each tick: update_cur_recent_cpu(): increment by one for current (non-idle) running thread

  • At 4th tick : update_priority() (doing it first to take into account the newly created one?)

  • Yield if necessary?

For thread_next_to_run():

  • choose the highest queue and get the first guy.

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.