All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class magician.Node.Scheduler

java.lang.Object
   |
   +----magician.Node.Scheduler

public class Scheduler
extends Object
implements PerfConstants
Class Scheduler ensures that only a fixed number of threads are running at a certain interval. If the maximum number of threads is reached, the new thread is put in the queue and is scheduled to run when possible. The priority of a thread is lowered periodically to give a new thread a chance to run.


Variable Index

 o EventMgr
Event manager to log events
 o maxThreads
maximum number of SmartPacket threads that can run concurrently
 o QTime
table to maintain queueng times
 o readyQueue
the queue of ready Smartpacket threads
 o runningThreads
list of running SmartPacket threads
 o ticker
the clock thread

Constructor Index

 o Scheduler(int)
initializes the scheduler with the maximum number of runnable threads

Method Index

 o invoke()
invokes the Schduler to remove the calling Smartpacket thread
 o Schedule(SPThread)
Schedules the Smartpacket thread for execution
 o tick()
checks on active threads and performs thread maintenance

Variables

 o maxThreads
 protected int maxThreads
maximum number of SmartPacket threads that can run concurrently

 o readyQueue
 protected SchedQueue readyQueue
the queue of ready Smartpacket threads

 o runningThreads
 protected UnsynchVector runningThreads
list of running SmartPacket threads

 o EventMgr
 EventManager EventMgr
Event manager to log events

 o QTime
 protected Hashtable QTime
table to maintain queueng times

 o ticker
 static Thread ticker
the clock thread

Constructors

 o Scheduler
 public Scheduler(int maxThreads)
initializes the scheduler with the maximum number of runnable threads

Parameters:
maxThreads - number of threads

Methods

 o tick
 public void tick()
checks on active threads and performs thread maintenance

 o invoke
 protected static void invoke()
invokes the Schduler to remove the calling Smartpacket thread

 o Schedule
 public void Schedule(SPThread t)
Schedules the Smartpacket thread for execution

Parameters:
t - the Smartpacket thread

All Packages  Class Hierarchy  This Package  Previous  Next  Index
1