Class DiskScheduler

java.lang.Object
  |
  +--Scheduler
        |
        +--DiskScheduler

public class DiskScheduler
extends Scheduler

A FCFS scheduler for the disk. It maintains a simple queue of jobs.


Fields inherited from class Scheduler
baseQuantum
 
Constructor Summary
DiskScheduler()
           
 
Method Summary
 boolean add(Job j, Job dummy)
          Add a new job wanting service.
 void printQueue()
          For debugging: print the queue of waiting jobs
 Job remove()
          Retrieve (and remove) the next job to be served.
 boolean reschedule(Job j)
          This method is called when there is a clock interrupt, and just after a job changes state.
 
Methods inherited from class Scheduler
endBurst, getBaseQuantum, getQuantum, printStats, queueChanged, setBaseQuantum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiskScheduler

public DiskScheduler()
Method Detail

add

public boolean add(Job j,
                   Job dummy)
Add a new job wanting service.
Overrides:
add in class Scheduler
Parameters:
j - the job to serve
dummy - always null
Returns:
false (this scheduler never preempts)

remove

public Job remove()
Retrieve (and remove) the next job to be served.
Overrides:
remove in class Scheduler
Returns:
the next job (null if there is no such job).

reschedule

public boolean reschedule(Job j)
This method is called when there is a clock interrupt, and just after a job changes state.
Overrides:
reschedule in class Scheduler
Parameters:
j - the job currently being serviced by the corresponding device.
Returns:
true if the scheduler wants to preempt the current job.

printQueue

public void printQueue()
For debugging: print the queue of waiting jobs
Overrides:
printQueue in class Scheduler