Project 3 roadmap
Download
1 / 6

Project 3 Roadmap - PowerPoint PPT Presentation


  • 167 Views
  • Uploaded on

Project 3 Roadmap. Multilevel Feedback Scheduling Semaphores. Multilevel Feedback Scheduling. struct Kernel_Thread in kthread.h current queue: int currentReadyQueue blocked state: bool blocked there are 4 run queues now: s_runQueue[MAX_QUEUE_LEVEL] in kthread.c

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Project 3 Roadmap' - niveditha


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Project 3 roadmap l.jpg

Project 3 Roadmap

Multilevel Feedback Scheduling

Semaphores


Multilevel feedback scheduling l.jpg
Multilevel Feedback Scheduling

  • struct Kernel_Thread in kthread.h

    • current queue: int currentReadyQueue

    • blocked state: bool blocked

  • there are 4 run queues now:

    • s_runQueue[MAX_QUEUE_LEVEL] in kthread.c

  • a thread is initially in s_runQueue[0]

    • except IDLE thread that enters at 3 when switching to MLF mode

  • check the scenarios

    • Find_Best() automatically pick the highest priority thread in a queue

    • Get_Next_Runnable() will call Find_Best() for each queue until it finds a ready process


Multilevel feedback scheduling3 l.jpg
Multilevel Feedback Scheduling

  • end of quantum ?

    • if blocked promote

    • if has just run demote (check TODO in Timer_Interrupt_Handler() defined in timer.c)

  • make sure your Sys_SetSchedulingPolicy() works before stuff gets complicated

  • A thread becomes blocked in Wait().


Semaphores l.jpg
Semaphores

  • rough guideline

    • add two files sem.h/sem.c

    • create a semaphore structure

    • each has a thread queue, count, name, etc

    • P/V semantics

      • P decrease, block if needed

      • V increase, never blocks

      • section 7.4.2 in the textbook, pp 203


Testing your code l.jpg
Testing Your Code

  • workload.exe [rr/mlf] [quantum]

  • ping.exe & pong.exe


Gettimeofday l.jpg
GetTimeOfDay()

  • Sys_GetTimeOfDay - trivial

    • (return g_numTicks)


ad