
These comments are no replacement for coming to talk to me in office
hours. I am here to help!
Comments on Homework 4 and Quiz 4
How do we solve the machine-scheduling problem / apply the list processing
algorithm? It comes in two parts:
•an order-requirement digraph. This tells me what is physically possible
at each moment in time. A task is not ready until all of the tasks
before it (on the order-requirement digraph) are completed. If T1must
be performed before T2, then it is not enough to assign T1before T2. I
must wait T1is finished, before I can assign T2.
•a priority list. This tells me what order I would prefer to do things
in (if I did not have to worry about the order-requirement digraph).
Suppose my priority list starts T3,T4,T1, . . .. I start by looking at
the order-requirement digraph and asking ”Is T3ready?” If it is ready,
then I assign it to the first free processor. If T3is not ready, then I
move onto the next item on the list and ask ”Is T4ready?” I continue
in this way until I find a ready task. The only time a processor idles is
if NO tasks are ready. In particular, the priority list does NOT mean
”I must do T3before I do T4”. It means I ask ”Is T3ready?” before I
ask ”Is T4ready?”
•If T3was not ready and T4was ready, I would assign T4to the first free
processor and cross T4off the priority list. When I next try to assign
a task, I start at the beginning of my priority list T3,T1, . . . , with T3
and not T1.
It is important to know what tasks are ready. In class, I have suggested
two things which may help.
•Keep track of how much time has passed.
•Cross tasks off the order-requirement digraph only when they have been
finished, not when they are assigned.
About Bin-Packing
1