J-Sim v1.2.1-p7 API

drcl.sim.process
Class SMMTSimulator

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.ForkManager
          extended bydrcl.comp.ACARuntime
              extended bydrcl.comp.ARuntime
                  extended bydrcl.sim.process.SMMTSimulator
All Implemented Interfaces:
java.lang.Cloneable, ObjectDuplicable, java.io.Serializable

public class SMMTSimulator
extends ARuntime

This class implements a Single-Machine Multi-Threaded simulation engine.

See Also:
Serialized Form

Field Summary
static java.lang.String Debug_LEAP_FORWARD
           
 
Fields inherited from class drcl.comp.ARuntime
cwf, Debug_Q, Debug_RECYCLE, Debug_STATE, Debug_THREAD, Debug_THREAD_STATE, Debug_WORKFORCE, ltime, nEvents, nLags, nthreadsWaiting, qReady, rtEnabled, rtTol, startTime, State_RESETTING, State_SUSPENDING, threadGroup, threadPool, time, total, totalThreadRequests, wakeupThread, wf
 
Fields inherited from class drcl.comp.ACARuntime
debug, DEFAULT_RUNTIME, logenabled, name, resetting, state, State_INACTIVE, State_RUNNING, State_SUSPENDED, tf, timeScale, timeScaleReciprocal, tr, vStateListener
 
Fields inherited from class drcl.comp.ForkManager
parent, runtime
 
Constructor Summary
SMMTSimulator()
           
SMMTSimulator(java.lang.String name_)
           
 
Method Summary
protected  double _getTime()
          Asynchronized version of getTime(), for diagnosis.
 void reset()
          The workerpool enters a transitional period when reset() is issued.
protected  void systemBecomesIdle(AWorkerThread exe_)
          Subclasses should override this method to handle the event when all workerthreads in the system are either waiting or idle but there are still tasks in the waiting queue.
protected  java.lang.String t_info(java.lang.String prefix_)
           
 
Methods inherited from class drcl.comp.ARuntime
___PROFILE___, _getEventRate, _stop, a_info, adjustTime, forceReset, getAvailableWorkforce, getEfficiencyIndex, getEventEfficiencyIndex, getEventQueue, getEventRate, getMaxWorkforce, getNumberOfArrivalEvents, getNumberOfIdleThreads, getNumberOfThreadRequests, getNumberOfThreadsCreated, getNumberOfWorkingThreads, getNumLaggingEvents, getQ, getRTEvaluation, getRTTolerance, getThreadGroup, getThreadRequestRate, getWallTimeElapsed, getWorkingThread, getWorkingThreads, grabOne, info, isIdle, isResetting, isRTEnabled, listThreads, newTask, newThread, off, print, println, recordTime, recycle, resume, s_info, s_info, setMaxWorkforce, setRTEnabled, setRTTolerance, setState, ss_info, sthreads, swthreads, systemBecomesInactive, t_info, tasks, threadBecomesWaiting, threadRequestsSleeping, threads, threadStateChange, triggerWakeupThread, wakeupThreadInfo, wthreads
 
Methods inherited from class drcl.comp.ACARuntime
_openlog, a_info, addDebugLevel, addRunnable, addRunnable, addRunnableAt, addRunnableAt, addStateListener, childManager, containsDebugLevel, debug_info, diag, diag, finalized, getAllDebugLevels, getAllStateListeners, getName, getParent, getState, getThread, getTime, getTimeScale, isDebugEnabled, isDebugEnabledAt, isRunning, isStopped, isSuspended, notifyStateListeners, process, reboot, receive, receiveAt, removeDebugLevel, removeStateListener, resumeFor, resumeTo, send, sendAt, setDebugEnabled, setDebugEnabledAt, setDebugLevels, setName, setParent, setRuntime, setTimeScale, stop, stop, stopAt, takeover, takeover, toString, tr_info
 
Methods inherited from class drcl.comp.ForkManager
a_list, getRuntime, info, list, takeover
 
Methods inherited from class drcl.DrclObj
clone, duplicate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Debug_LEAP_FORWARD

public static final java.lang.String Debug_LEAP_FORWARD
See Also:
Constant Field Values
Constructor Detail

SMMTSimulator

public SMMTSimulator()

SMMTSimulator

public SMMTSimulator(java.lang.String name_)
Method Detail

reset

public void reset()
Description copied from class: ARuntime
The workerpool enters a transitional period when reset() is issued. It waits for all the working thread to either finishes the job or goes into sleep. After all the threads finish jobs, it releases all the threads by kill()ing them.

CAUTION: 1. This method is better be executed by a thread that is not created from this worker pool, unless you know what you're doing. 2. Current implementation does not work if a thread executes indefinitely.

Overrides:
reset in class ARuntime

systemBecomesIdle

protected void systemBecomesIdle(AWorkerThread exe_)
Description copied from class: ARuntime
Subclasses should override this method to handle the event when all workerthreads in the system are either waiting or idle but there are still tasks in the waiting queue.

Overrides:
systemBecomesIdle in class ARuntime
Parameters:
exe_ - current thread, requests waiting and leads the system to the idle state.

_getTime

protected double _getTime()
Description copied from class: ARuntime
Asynchronized version of getTime(), for diagnosis. Subclasses should override this method to provide its own time mapping function.

Overrides:
_getTime in class ARuntime

t_info

protected java.lang.String t_info(java.lang.String prefix_)
Overrides:
t_info in class ARuntime

J-Sim v1.2.1-p7 API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~