From 39456e9c18a0d3a2d2d241ca623ff9bc27f76510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Wed, 10 Feb 2021 15:49:12 +0100 Subject: [PATCH] README: remove claim about temp var reordering (#155) ...between `await` calls. Can no longer replicate. --- README.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/README.md b/README.md index 2800c2d..6db0c34 100644 --- a/README.md +++ b/README.md @@ -122,19 +122,6 @@ proc p3() {.async.} = waitFor p3() ``` -Not as intuitive, but the same thing happens if we create those futures on the -same line as `await`, due to the Nim compiler's use of hidden temporary -variables: - -```nim -proc p4() {.async.} = - await p1() - await p2() - # Also takes a single second for both futures sleeping concurrently. - -waitFor p4() -``` - Don't let `await`'s behaviour of giving back control to the dispatcher surprise you. If an async procedure modifies global state, and you can't predict when it will start executing, the only way to avoid that state changing underneath your