I'm a very newbie in javaflow. Consider the following basic example:
class MyRunnable implements Runnable {
  public void run() {
    System.out.println("started!");
    for( int i=0; i<10; i++ )
      echo(i);
  }
  private void echo(int x) {
    System.out.println(x);
    Continuation.suspend();
  }
}

Continuation c = Continuation.startWith(new MyRunnable());
Continuation d = Continuation.continueWith(c);
Continuation e = Continuation.continueWith(d);
Continuation f = Continuation.continueWith(d);
if (e.equals(f)) System.out.println("They are equal!");
else System.out.println("They are not equal!");


Both continuation e and f start with same check point (d) and capture the
same stacks and also both of them print 1. Then still why "They are not
equal!"? (program gives this output). Can someone please explain it to me?

Thanks,
Sainan

Reply via email to