Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. rule: if a job uses its entire timeslice, it moves down a queue
  2.  
  3. suppose timeout = 9
  4.  
  5. int t schedule_job(A, 9);
  6.  
  7. if(t < 0)
  8.  //done
  9.  get current time and add to total turnaround
  10.  remove job
  11.  
  12. else if(t == timeout){
  13.     reduce queue level
  14. }else{
  15.     move to the back of the current queue
  16.     (can use a pointer or index and just move up one index)
  17.     (probably gonna have to move it back to the beginning)
  18. }
  19.  
  20. response time: time first run - time of arrival
  21.  
  22. pointer to whatever queue is the current one
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement