|
|||||||
| 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.
| Field Summary | |
private Job |
head
The head of a queue of jobs awaiting service. |
private Job |
tail
|
| Fields inherited from class Scheduler |
lastChanged,
lenSum,
maxLen,
MAXQUEUE,
qlen,
queueHist |
| Constructor Summary | |
(package private) |
RRScheduler()
|
| Method Summary | |
boolean |
add(Job j)
Add a new job wanting service. |
void |
printQueue()
For debugging: print the queue of waiting jobs |
private java.lang.String |
queueString()
For debugging. |
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 |
printStats,
queueChanged |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private Job head
private Job tail
| Constructor Detail |
RRScheduler()
| Method Detail |
public boolean add(Job j)
j - the job to servepublic Job remove()
public boolean reschedule(Job j)
j - the job currently being serviced by the corresponding device.public void printQueue()
private java.lang.String queueString()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||