|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--Scheduler
|
+--RRScheduler
A round-robin Scheduler for a CPU. It maintains a linked list of jobs. This scheduler is remarkably similar to the DiskScheduler.
| Fields inherited from class Scheduler |
baseQuantum |
| Constructor Summary | |
RRScheduler()
|
|
| Method Summary | |
boolean |
add(Job newJob,
Job currentJob)
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 decides whether to preempt the current job. |
java.lang.String |
toString()
For debugging: a concise version of the queue |
| 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,
wait,
wait,
wait |
| Constructor Detail |
public RRScheduler()
| Method Detail |
public boolean add(Job newJob,
Job currentJob)
newJob - the job newly awaiting service for the device.currentJob - the job currently using the device, if any (ignored)public Job remove()
public boolean reschedule(Job j)
j - the job currently being serviced by the corresponding device.public void printQueue()
public java.lang.String toString()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||