Changes

Jump to: navigation, search

Computer Science/162/proj1

472 bytes added, 04:41, 5 October 2008
Implementation
* PriorityQueue.pickNextThread()
* Simply retrieves the highest priority thread off this queue.
* PriorityQueue.setDirty()
* Set this queue's dirty flag, and calls setDirty on the current holder of this thread.
* PriorityQueue.getEffectivePriority()
* If this queue is "dirty", returns the maximum of each of the ThreadStates.getEffectivePriority() in this queue. Those calls in turn become mutually recursive when they call getEffectivePriority on the PriorityQueues in their myResrouces.
* ThreadState.setPriority() * This method will change the actual priority of the thread associated with the ThreadState. The effective priority It then does setDirty() on this thread* ThreadState.setDirty()* Sets the dirty flag on this thread, then on each of lastThread must also be by difference between current threads priority and new prioritythe PriorityQueues that the thread is waiting for, does setDirty on them. Mutually recursive.* ThreadState. getEffectivePriority*Like the analogue of this function in PriorityQueue, returns the priority if this thread is not dirty, otherwise recalculates by returning the max of the effective priorities of the PriorityQueues in myResources.
===Testing===
Anonymous user

Navigation menu