Skip to content

Instantly share code, notes, and snippets.

@isaacs
Last active April 8, 2018 01:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save isaacs/6325173 to your computer and use it in GitHub Desktop.
Save isaacs/6325173 to your computer and use it in GitHub Desktop.
var x = 1
function a() {
var i = 0
do {
x = 1;
hm();
} while (x === 1 && ++i<1e9);
assert(x === 1)
assert(i === 1e9)
}
function b() {
var i = 0
do {
x = 100;
hm();
} while (x === 100 && ++i<1e9);
assert(x === 100)
assert(i === 1e9)
}
// will this blow up?
// ie, is parallel *actually* running the JS in parallel?
// or just parallelizing the yields?
// is hm() yielding? does that matter?
parallel(a, b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment