Package kilim.examples
Class Chain
- java.lang.Object
-
- kilim.Task
-
- kilim.examples.Chain
-
- All Implemented Interfaces:
java.lang.Runnable,EventSubscriber,Fiber.Worker
public class Chain extends Task
Set up a chain of tasks. Each task knows about its mailbox and that of the next in the chain, but is not given the other tasks ref. The main thread pushes an empty StringBuffer into the first task's mailbox, which writes "hello" into the buffer and passes the modified StringBuffer on to the next task, and so on. The last task appends "world", prints it out and exits. [compile] javac -d ./classes Chain.java [weave] java kilim.tools.Weave -d ./wclasses kilim.examples.Chain [run] java -cp ./wclasses:./classes:$CLASSPATH kilim.examples.Chain
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class kilim.Task
Task.Fork, Task.Invoke<TT>, Task.Spawn<TT>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()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
-
-