Frequently Asked Questions (FAQ)
Last updated: Sun Mar 26 09:17:34
A:
A:
That said, most of your changes will probably be in the RRScheduler class. The methods in this class will be completely rewritten to implement the TSScheduler. You may want to add some of the methods that correspond to those in Solaris, for example tick(), update(), sleep(), wakeup(), and preempt().
You will probably make a small number of changes to Sim. For example, you will need to read the dispatch table in from a file and into a table in memory.
You will also need to add a few variables to the Job class. Most of the variables will be used for scheduling: the priority of the job, the timeleft in the current timeslice, the value of dispwait, and perhaps a flag designating state of the job (RUNNING, READY, or BLOCKED). You will also need a variable corresponding to the length of an I/O burst (see next paragraph). Of couse, you will also need to add corresponding methods to access these variables from other classes.
Finally, you will need to change the JobArrival class so that the duration of an I/O burst can be specified in the trace file. The duration of an I/O burst is currently a constant in Sim; this will now be a variable associated with each Job.
A:
A:
A:
# Time Sharing Dispatcher Configuration
RES=1000
# ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait PRIORITY LEVEL
200 0 50 0 50 # 0
200 0 50 0 50 # 1
200 0 50 0 50 # 2
200 ...
When you create your file containing the dispatch table, you should omit
the first 4 lines of the output and start with the lines that form the
actual table:
200 0 50 0 50 # 0
200 0 50 0 50 # 1
200 0 50 0 50 # 2
200 ...
Note that when you read in the table, you will want to divide the first
column (the quantum specified in milliseconds) by the length of the clock
tick (i.e., 10ms). This will simplify your implementation of the TS.tick()
method.
A:
A:
Yes, you should have just one update() routine for all jobs that runs once a second. The result is that a job could have its dispwait incremented after it has been in the system for only 1ms, as in your example.
A:
A: