jist.swans.app.lang
Class SimtimeThread

java.lang.Object
  extended by jist.swans.app.lang.SimtimeThread
All Implemented Interfaces:
JistAPI.Proxiable, JistAPI.Timeless, ThreadInterface

public class SimtimeThread
extends java.lang.Object
implements ThreadInterface, JistAPI.Proxiable

SWANS simulation time implementation of a Java thread. Note that this thread implementation differs from the Java specification. 1. It is cooperative (not pre-emptive), since we are optimizing for throughput, not concurrency. Use the yield() command. Theoretically, these can be weaved into the code automatically, but at a performance cost. Again, throughput performance was considered to be more important than transparency in this case. 2. Implementation of daemon modes, thread priority, class loader, security contexts, interrupts, suspend/resume/stop, thread groups, and subclassing of the base thread class are not supported in the current implementation. They can be added later, or provided in alternative simulation time thread implementation. 3. Note that in this implementation each sleep/yield performs a blocking sleep, thus incurring two blocking simulation events.

Since:
SWANS1.0

Constructor Summary
SimtimeThread()
           
SimtimeThread(java.lang.Runnable target)
           
SimtimeThread(java.lang.Runnable target, java.lang.String name)
           
SimtimeThread(java.lang.String name)
           
SimtimeThread(java.lang.ThreadGroup group, java.lang.Runnable target)
           
SimtimeThread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name)
           
SimtimeThread(java.lang.ThreadGroup group, java.lang.String name)
           
 
Method Summary
static SimtimeThread currentThread()
           
 java.lang.String getName()
           
static void InitializeApplicationContext(AppInterface.ThreadedApp app)
           
 boolean isAlive()
           
 void join()
           
 void setName(java.lang.String name)
           
static void sleep(long millis)
           
static void sleep(long millis, int nanos)
           
 void start()
           
 void ThreadJoin()
           
 void ThreadRun()
           
 java.lang.String toString()
           
static void yield()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimtimeThread

public SimtimeThread()

SimtimeThread

public SimtimeThread(java.lang.Runnable target)

SimtimeThread

public SimtimeThread(java.lang.ThreadGroup group,
                     java.lang.Runnable target)

SimtimeThread

public SimtimeThread(java.lang.String name)

SimtimeThread

public SimtimeThread(java.lang.ThreadGroup group,
                     java.lang.String name)

SimtimeThread

public SimtimeThread(java.lang.Runnable target,
                     java.lang.String name)

SimtimeThread

public SimtimeThread(java.lang.ThreadGroup group,
                     java.lang.Runnable target,
                     java.lang.String name)
Method Detail

InitializeApplicationContext

public static void InitializeApplicationContext(AppInterface.ThreadedApp app)

currentThread

public static SimtimeThread currentThread()

isAlive

public boolean isAlive()

start

public void start()

ThreadRun

public void ThreadRun()
Specified by:
ThreadRun in interface ThreadInterface

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

yield

public static void yield()

sleep

public static void sleep(long millis)

sleep

public static void sleep(long millis,
                         int nanos)

join

public void join()

ThreadJoin

public void ThreadJoin()
                throws JistAPI.Continuation
Specified by:
ThreadJoin in interface ThreadInterface
Throws:
JistAPI.Continuation