Package kilim.examples
Class Ex
- java.lang.Object
-
- kilim.Task
-
- kilim.examples.Ex
-
- All Implemented Interfaces:
java.lang.Runnable,EventSubscriber,Fiber.Worker
public class Ex extends Task
Spawn a task, communicate through a shared mailbox. The task's termination is knowm through another mailbox. The structure of this class is not much different from a Thread version that uses PipedInput/OutputStreams (Task instead of Thread, execute() instead of run(), and typed, buffered mailboxes instead of pipes. [compile] javac -d ./classes Ex.java [weave] java kilim.tools.Weave -d ./classes kilim.examples.Ex [run] java -cp ./classes:./classes:$CLASSPATH kilim.examples.Ex
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class kilim.Task
Task.Fork, Task.Invoke<TT>, Task.Spawn<TT>
-
-
Constructor Summary
Constructors Constructor Description Ex()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()The entry point.private voidfoo(int i)static voidmain(java.lang.String[] args)-
Methods inherited from class kilim.Task
checkKill, dump, equals, errNotWoven, errNotWoven, errorExit, errorExit, execute, exit, exit, fork, getCurrentTask, getExecutionThread, getPauseReason, getScheduler, getStackDepth, getState, getTid, hashCode, id, idledown, informOnExit, invoke, isDone, join, joinb, onEvent, pause, pause, pinToThread, prePin, resume, resumeOnScheduler, run, setPauseReason, setScheduler, setTid, shutdown, sleep, spawn, spawn, start, toString, unpinFromThread, yield, yield
-
-
-
-
Field Detail
-
mb
static Mailbox<java.lang.String> mb
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
execute
public void execute() throws PausableThe entry point. mb.get() is a blocking call that yields the thread ("pausable")- Specified by:
executein interfaceFiber.Worker- Overrides:
executein classTask- Throws:
Pausable
-
-