jist.swans.app.lang
Class SimtimeThread
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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)
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