}
void run() throws ExecutionException, InterruptedException {
final long start = System.nanoTime();
final IntChannel managerChannel = Channels.newIntChannel(mailboxSize);
IntChannel a = managerChannel;
for (int i = 0; i < N - 1; i++)
a = createRelayActor(a);
final IntChannel lastChannel = a;
Fiber<Integer> manager = new Fiber<Integer>() {
@Override
protected Integer run() throws InterruptedException, SuspendExecution {
lastChannel.send(1); // start things off
int msg = 0;
try {
for (int i = 0; i < M; i++) {
msg = managerChannel.receiveInt();
lastChannel.send(msg + 1);
}
return msg;
} catch (ReceivePort.EOFException e) {
return null;
}