Skip to content

Instantly share code, notes, and snippets.

@evanzillians
Last active August 29, 2015 13:59
Show Gist options
  • Save evanzillians/10448466 to your computer and use it in GitHub Desktop.
Save evanzillians/10448466 to your computer and use it in GitHub Desktop.
Proposal of new design of async
task do_a(n: int32): int32 { ... }
task do_b(n: int32): int32 { ... }
task test(target: Domain): void
{
do_a(1); // call do_a
do_b(2); // call do_b
16: do_a(1); // call do_a with 16 times
16: do_b(2); // call do_b with 16 times
-> do_a(1); // async call do_a
-> do_b(2); // async call do_b
-> 16: do_a(1); // async call do_a with 16 times
-> 16: do_b(2); // async call do_b with 16 times
-> { var i = 0; do_a(i + 1); } // async call piece of code
-> { var i = 0; do_b(i + 2); } // async call piece of code
-> 16: { var i = 0; do_a(i + 1); } // async call piece of code with 16 times
-> 16: { var i = 0; do_b(i + 2); } // async call piece of code with 16 times
on target: do_a(1); // ERROR, waiting for remote invocation is not allowed.
on target: do_b(1); // ERROR, waiting for remote invocation is not allowed.
on target, 16: do_a(1); // ERROR, waiting for remote invocation is not allowed.
on target, 16: do_b(1); // ERROR, waiting for remote invocation is not allowed.
-> on target: do_a(1); // async call do_a on target
-> on target: do_b(1); // async call do_b on target
-> on target, 16: do_a(1); // async call do_a on target with 16 times
-> on target, 16: do_b(1); // async call do_a on target with 16 times
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment