await some functions and continue to run some code while waiting for Task.WhenAll?Why shouldn't all functions be async by default?Second await Statement Inside Function Never RunsAwait multiple async Task while setting max running task at a timeAsp.net mvc5 . async await. wait on task with diff return typesawait call doesn't return call to the caller if the task awaited has a long running CPU operation in itAsync wpf event with 'Task.Factory.StartNew' does not wait for awaitHow run async / await in parallel in JavascriptWhat is difference between put code after await v.s. chain code using ContinueWithShould I await a 'async Task' function if I don't care its return value?ES8 await call isn't waiting for me
Engineer refusing to file/disclose patents
Difference between -| and |- in TikZ
Confusion on Parallelogram
What does the Rambam mean when he says that the planets have souls?
Drawing ramified coverings with tikz
Is there a word to describe the feeling of being transfixed out of horror?
Divine apple island
Is it improper etiquette to ask your opponent what his/her rating is before the game?
How to color a curve
Why do IPv6 unique local addresses have to have a /48 prefix?
How much character growth crosses the line into breaking the character
Have I saved too much for retirement so far?
How should I respond when I lied about my education and the company finds out through background check?
What is the grammatical term for “‑ed” words like these?
Indicating multiple different modes of speech (fantasy language or telepathy)
MAXDOP Settings for SQL Server 2014
Journal losing indexing services
Longest common substring in linear time
Can the Supreme Court overturn an impeachment?
Is it possible to use .desktop files to open local pdf files on specific pages with a browser?
Drawing a topological "handle" with Tikz
Visiting the UK as unmarried couple
How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?
How do I implement a file system driver driver in Linux?
await some functions and continue to run some code while waiting for Task.WhenAll?
Why shouldn't all functions be async by default?Second await Statement Inside Function Never RunsAwait multiple async Task while setting max running task at a timeAsp.net mvc5 . async await. wait on task with diff return typesawait call doesn't return call to the caller if the task awaited has a long running CPU operation in itAsync wpf event with 'Task.Factory.StartNew' does not wait for awaitHow run async / await in parallel in JavascriptWhat is difference between put code after await v.s. chain code using ContinueWithShould I await a 'async Task' function if I don't care its return value?ES8 await call isn't waiting for me
There are the following functions.
async Task<int> T1() Console.WriteLine("T1"); return await Task.FromResult(1);
async Task<string> T2() Console.WriteLine("T2"); return await Task.FromResult("T2");
async Task<char> T3() await Task.Delay(2000); Console.WriteLine("T3"); return await Task.FromResult('A');
async Task<string> T4() Console.WriteLine("T4"); return await Task.FromResult("T4");
// U1, U2, U3, and U4 need to be run right after T1, T2, T3, and T4 respectively
void U1() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T1");
void U2() System.Threading.Thread.Sleep(4000); Console.WriteLine($"After T2");
void U3() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T3");
void U4() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T4");
// TAll() needs to be run as soon as T1, T2, T3, and T4 finished.
void TAll() Console.WriteLine("To be run after T1, T2, T3, T4");
// All() runs after all functions are done.
void All() Console.WriteLine("To be run after U1, U2, U3, U4");
However, the following calls
var t1 = T1().ContinueWith(_ => U1());
var t2 = T2().ContinueWith(_ => U2());
var t3 = T3().ContinueWith(_ => U3());
var t4 = T4().ContinueWith(_ => U4());
await Task.WhenAll(t1, t2, t3, t4);
TAll();
All();
returns
T1
T2
T4
After T1
After T4
T3
After T3
After T2
To be run after T1, T2, T3, T4
To be run after U1, U2, U3, U4
The expected output order is
T1
T2
T4
After T1
After T4
T3
To be run after T1, T2, T3, T4
After T3
After T2
To be run after U1, U2, U3, U4
c# async-await task
add a comment |
There are the following functions.
async Task<int> T1() Console.WriteLine("T1"); return await Task.FromResult(1);
async Task<string> T2() Console.WriteLine("T2"); return await Task.FromResult("T2");
async Task<char> T3() await Task.Delay(2000); Console.WriteLine("T3"); return await Task.FromResult('A');
async Task<string> T4() Console.WriteLine("T4"); return await Task.FromResult("T4");
// U1, U2, U3, and U4 need to be run right after T1, T2, T3, and T4 respectively
void U1() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T1");
void U2() System.Threading.Thread.Sleep(4000); Console.WriteLine($"After T2");
void U3() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T3");
void U4() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T4");
// TAll() needs to be run as soon as T1, T2, T3, and T4 finished.
void TAll() Console.WriteLine("To be run after T1, T2, T3, T4");
// All() runs after all functions are done.
void All() Console.WriteLine("To be run after U1, U2, U3, U4");
However, the following calls
var t1 = T1().ContinueWith(_ => U1());
var t2 = T2().ContinueWith(_ => U2());
var t3 = T3().ContinueWith(_ => U3());
var t4 = T4().ContinueWith(_ => U4());
await Task.WhenAll(t1, t2, t3, t4);
TAll();
All();
returns
T1
T2
T4
After T1
After T4
T3
After T3
After T2
To be run after T1, T2, T3, T4
To be run after U1, U2, U3, U4
The expected output order is
T1
T2
T4
After T1
After T4
T3
To be run after T1, T2, T3, T4
After T3
After T2
To be run after U1, U2, U3, U4
c# async-await task
You are actually waiting for all continuations to finish not their target tasks...
– Johnny
Mar 8 at 7:16
If I wait all on T#, the U# will not be called right after T functions are done.
– ca9163d9
Mar 8 at 7:22
add a comment |
There are the following functions.
async Task<int> T1() Console.WriteLine("T1"); return await Task.FromResult(1);
async Task<string> T2() Console.WriteLine("T2"); return await Task.FromResult("T2");
async Task<char> T3() await Task.Delay(2000); Console.WriteLine("T3"); return await Task.FromResult('A');
async Task<string> T4() Console.WriteLine("T4"); return await Task.FromResult("T4");
// U1, U2, U3, and U4 need to be run right after T1, T2, T3, and T4 respectively
void U1() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T1");
void U2() System.Threading.Thread.Sleep(4000); Console.WriteLine($"After T2");
void U3() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T3");
void U4() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T4");
// TAll() needs to be run as soon as T1, T2, T3, and T4 finished.
void TAll() Console.WriteLine("To be run after T1, T2, T3, T4");
// All() runs after all functions are done.
void All() Console.WriteLine("To be run after U1, U2, U3, U4");
However, the following calls
var t1 = T1().ContinueWith(_ => U1());
var t2 = T2().ContinueWith(_ => U2());
var t3 = T3().ContinueWith(_ => U3());
var t4 = T4().ContinueWith(_ => U4());
await Task.WhenAll(t1, t2, t3, t4);
TAll();
All();
returns
T1
T2
T4
After T1
After T4
T3
After T3
After T2
To be run after T1, T2, T3, T4
To be run after U1, U2, U3, U4
The expected output order is
T1
T2
T4
After T1
After T4
T3
To be run after T1, T2, T3, T4
After T3
After T2
To be run after U1, U2, U3, U4
c# async-await task
There are the following functions.
async Task<int> T1() Console.WriteLine("T1"); return await Task.FromResult(1);
async Task<string> T2() Console.WriteLine("T2"); return await Task.FromResult("T2");
async Task<char> T3() await Task.Delay(2000); Console.WriteLine("T3"); return await Task.FromResult('A');
async Task<string> T4() Console.WriteLine("T4"); return await Task.FromResult("T4");
// U1, U2, U3, and U4 need to be run right after T1, T2, T3, and T4 respectively
void U1() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T1");
void U2() System.Threading.Thread.Sleep(4000); Console.WriteLine($"After T2");
void U3() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T3");
void U4() System.Threading.Thread.Sleep(1000); Console.WriteLine($"After T4");
// TAll() needs to be run as soon as T1, T2, T3, and T4 finished.
void TAll() Console.WriteLine("To be run after T1, T2, T3, T4");
// All() runs after all functions are done.
void All() Console.WriteLine("To be run after U1, U2, U3, U4");
However, the following calls
var t1 = T1().ContinueWith(_ => U1());
var t2 = T2().ContinueWith(_ => U2());
var t3 = T3().ContinueWith(_ => U3());
var t4 = T4().ContinueWith(_ => U4());
await Task.WhenAll(t1, t2, t3, t4);
TAll();
All();
returns
T1
T2
T4
After T1
After T4
T3
After T3
After T2
To be run after T1, T2, T3, T4
To be run after U1, U2, U3, U4
The expected output order is
T1
T2
T4
After T1
After T4
T3
To be run after T1, T2, T3, T4
After T3
After T2
To be run after U1, U2, U3, U4
c# async-await task
c# async-await task
edited Mar 8 at 7:45
Johnny
3,2101021
3,2101021
asked Mar 8 at 7:08
ca9163d9ca9163d9
8,4062694208
8,4062694208
You are actually waiting for all continuations to finish not their target tasks...
– Johnny
Mar 8 at 7:16
If I wait all on T#, the U# will not be called right after T functions are done.
– ca9163d9
Mar 8 at 7:22
add a comment |
You are actually waiting for all continuations to finish not their target tasks...
– Johnny
Mar 8 at 7:16
If I wait all on T#, the U# will not be called right after T functions are done.
– ca9163d9
Mar 8 at 7:22
You are actually waiting for all continuations to finish not their target tasks...
– Johnny
Mar 8 at 7:16
You are actually waiting for all continuations to finish not their target tasks...
– Johnny
Mar 8 at 7:16
If I wait all on T#, the U# will not be called right after T functions are done.
– ca9163d9
Mar 8 at 7:22
If I wait all on T#, the U# will not be called right after T functions are done.
– ca9163d9
Mar 8 at 7:22
add a comment |
3 Answers
3
active
oldest
votes
You should use async
and await
rather than ContinueWith
. In your case, adding new async
methods will simplify the code:
var t1 = T1();
var u1 = InvokeU1(t1);
var t2 = T2();
var u2 = InvokeU2(t2);
var t3 = T3();
var u3 = InvokeU3(t3);
var t4 = T4();
var u4 = InvokeU4(t4);
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(u1, u2, u3, u4);
All();
async Task InvokeU1(Task task) await task; U1();
async Task InvokeU2(Task task) await task; U2();
async Task InvokeU3(Task task) await task; U3();
async Task InvokeU4(Task task) await task; U4();
add a comment |
The continuation of the task is actually task. In your example your are awaiting on the continuations so "To be run after..." will be logged when all target tasks and all their continuations are done.
Consider this:
//target tasks
var t1 = T1();
var t2 = T2();
var t3 = T3();
var t4 = T4();
//continuations
var c1 = t1.ContinueWith(_ => U1());
var c2 = t2.ContinueWith(_ => U2());
var c3 = t3.ContinueWith(_ => U3());
var c4 = t4.ContinueWith(_ => U4());
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(c1, c2, c3, c4);
All();
The output will be in line with what you expect.
Update
Stephen added a good tip about ContinueWith
and I encourage you to use it. However regardless how dangerous ContinueWith
is here I tried to explain the problem conceptually.
Great. Is there other ways to do it without using continuewith?
– ca9163d9
Mar 8 at 14:33
1
@ca9163d9: You should not useContinueWith
in real-world code. Use anasync
method instead.
– Stephen Cleary
Mar 8 at 14:45
add a comment |
Since you have await Task.WhenAll(t1, t2, t3, t4);
this ensures T1(),T2(),T3(),T4() and its associated U1(),U2(),U3(),U4() (order depends upon the thread sleep or task.deley you have mentioned in each of those) to complete before it goes on to execute TALL() and ALL() in the sequence. Hence below two statement is the last to print
To be run after T1, T2, T3, T4
To be run after U1, U2, U3, U4
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058356%2fawait-some-functions-and-continue-to-run-some-code-while-waiting-for-task-whenal%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You should use async
and await
rather than ContinueWith
. In your case, adding new async
methods will simplify the code:
var t1 = T1();
var u1 = InvokeU1(t1);
var t2 = T2();
var u2 = InvokeU2(t2);
var t3 = T3();
var u3 = InvokeU3(t3);
var t4 = T4();
var u4 = InvokeU4(t4);
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(u1, u2, u3, u4);
All();
async Task InvokeU1(Task task) await task; U1();
async Task InvokeU2(Task task) await task; U2();
async Task InvokeU3(Task task) await task; U3();
async Task InvokeU4(Task task) await task; U4();
add a comment |
You should use async
and await
rather than ContinueWith
. In your case, adding new async
methods will simplify the code:
var t1 = T1();
var u1 = InvokeU1(t1);
var t2 = T2();
var u2 = InvokeU2(t2);
var t3 = T3();
var u3 = InvokeU3(t3);
var t4 = T4();
var u4 = InvokeU4(t4);
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(u1, u2, u3, u4);
All();
async Task InvokeU1(Task task) await task; U1();
async Task InvokeU2(Task task) await task; U2();
async Task InvokeU3(Task task) await task; U3();
async Task InvokeU4(Task task) await task; U4();
add a comment |
You should use async
and await
rather than ContinueWith
. In your case, adding new async
methods will simplify the code:
var t1 = T1();
var u1 = InvokeU1(t1);
var t2 = T2();
var u2 = InvokeU2(t2);
var t3 = T3();
var u3 = InvokeU3(t3);
var t4 = T4();
var u4 = InvokeU4(t4);
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(u1, u2, u3, u4);
All();
async Task InvokeU1(Task task) await task; U1();
async Task InvokeU2(Task task) await task; U2();
async Task InvokeU3(Task task) await task; U3();
async Task InvokeU4(Task task) await task; U4();
You should use async
and await
rather than ContinueWith
. In your case, adding new async
methods will simplify the code:
var t1 = T1();
var u1 = InvokeU1(t1);
var t2 = T2();
var u2 = InvokeU2(t2);
var t3 = T3();
var u3 = InvokeU3(t3);
var t4 = T4();
var u4 = InvokeU4(t4);
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(u1, u2, u3, u4);
All();
async Task InvokeU1(Task task) await task; U1();
async Task InvokeU2(Task task) await task; U2();
async Task InvokeU3(Task task) await task; U3();
async Task InvokeU4(Task task) await task; U4();
answered Mar 8 at 14:50
Stephen ClearyStephen Cleary
286k47482603
286k47482603
add a comment |
add a comment |
The continuation of the task is actually task. In your example your are awaiting on the continuations so "To be run after..." will be logged when all target tasks and all their continuations are done.
Consider this:
//target tasks
var t1 = T1();
var t2 = T2();
var t3 = T3();
var t4 = T4();
//continuations
var c1 = t1.ContinueWith(_ => U1());
var c2 = t2.ContinueWith(_ => U2());
var c3 = t3.ContinueWith(_ => U3());
var c4 = t4.ContinueWith(_ => U4());
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(c1, c2, c3, c4);
All();
The output will be in line with what you expect.
Update
Stephen added a good tip about ContinueWith
and I encourage you to use it. However regardless how dangerous ContinueWith
is here I tried to explain the problem conceptually.
Great. Is there other ways to do it without using continuewith?
– ca9163d9
Mar 8 at 14:33
1
@ca9163d9: You should not useContinueWith
in real-world code. Use anasync
method instead.
– Stephen Cleary
Mar 8 at 14:45
add a comment |
The continuation of the task is actually task. In your example your are awaiting on the continuations so "To be run after..." will be logged when all target tasks and all their continuations are done.
Consider this:
//target tasks
var t1 = T1();
var t2 = T2();
var t3 = T3();
var t4 = T4();
//continuations
var c1 = t1.ContinueWith(_ => U1());
var c2 = t2.ContinueWith(_ => U2());
var c3 = t3.ContinueWith(_ => U3());
var c4 = t4.ContinueWith(_ => U4());
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(c1, c2, c3, c4);
All();
The output will be in line with what you expect.
Update
Stephen added a good tip about ContinueWith
and I encourage you to use it. However regardless how dangerous ContinueWith
is here I tried to explain the problem conceptually.
Great. Is there other ways to do it without using continuewith?
– ca9163d9
Mar 8 at 14:33
1
@ca9163d9: You should not useContinueWith
in real-world code. Use anasync
method instead.
– Stephen Cleary
Mar 8 at 14:45
add a comment |
The continuation of the task is actually task. In your example your are awaiting on the continuations so "To be run after..." will be logged when all target tasks and all their continuations are done.
Consider this:
//target tasks
var t1 = T1();
var t2 = T2();
var t3 = T3();
var t4 = T4();
//continuations
var c1 = t1.ContinueWith(_ => U1());
var c2 = t2.ContinueWith(_ => U2());
var c3 = t3.ContinueWith(_ => U3());
var c4 = t4.ContinueWith(_ => U4());
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(c1, c2, c3, c4);
All();
The output will be in line with what you expect.
Update
Stephen added a good tip about ContinueWith
and I encourage you to use it. However regardless how dangerous ContinueWith
is here I tried to explain the problem conceptually.
The continuation of the task is actually task. In your example your are awaiting on the continuations so "To be run after..." will be logged when all target tasks and all their continuations are done.
Consider this:
//target tasks
var t1 = T1();
var t2 = T2();
var t3 = T3();
var t4 = T4();
//continuations
var c1 = t1.ContinueWith(_ => U1());
var c2 = t2.ContinueWith(_ => U2());
var c3 = t3.ContinueWith(_ => U3());
var c4 = t4.ContinueWith(_ => U4());
await Task.WhenAll(t1, t2, t3, t4);
TAll();
await Task.WhenAll(c1, c2, c3, c4);
All();
The output will be in line with what you expect.
Update
Stephen added a good tip about ContinueWith
and I encourage you to use it. However regardless how dangerous ContinueWith
is here I tried to explain the problem conceptually.
edited Mar 9 at 8:20
answered Mar 8 at 7:26
JohnnyJohnny
3,2101021
3,2101021
Great. Is there other ways to do it without using continuewith?
– ca9163d9
Mar 8 at 14:33
1
@ca9163d9: You should not useContinueWith
in real-world code. Use anasync
method instead.
– Stephen Cleary
Mar 8 at 14:45
add a comment |
Great. Is there other ways to do it without using continuewith?
– ca9163d9
Mar 8 at 14:33
1
@ca9163d9: You should not useContinueWith
in real-world code. Use anasync
method instead.
– Stephen Cleary
Mar 8 at 14:45
Great. Is there other ways to do it without using continuewith?
– ca9163d9
Mar 8 at 14:33
Great. Is there other ways to do it without using continuewith?
– ca9163d9
Mar 8 at 14:33
1
1
@ca9163d9: You should not use
ContinueWith
in real-world code. Use an async
method instead.– Stephen Cleary
Mar 8 at 14:45
@ca9163d9: You should not use
ContinueWith
in real-world code. Use an async
method instead.– Stephen Cleary
Mar 8 at 14:45
add a comment |
Since you have await Task.WhenAll(t1, t2, t3, t4);
this ensures T1(),T2(),T3(),T4() and its associated U1(),U2(),U3(),U4() (order depends upon the thread sleep or task.deley you have mentioned in each of those) to complete before it goes on to execute TALL() and ALL() in the sequence. Hence below two statement is the last to print
To be run after T1, T2, T3, T4
To be run after U1, U2, U3, U4
add a comment |
Since you have await Task.WhenAll(t1, t2, t3, t4);
this ensures T1(),T2(),T3(),T4() and its associated U1(),U2(),U3(),U4() (order depends upon the thread sleep or task.deley you have mentioned in each of those) to complete before it goes on to execute TALL() and ALL() in the sequence. Hence below two statement is the last to print
To be run after T1, T2, T3, T4
To be run after U1, U2, U3, U4
add a comment |
Since you have await Task.WhenAll(t1, t2, t3, t4);
this ensures T1(),T2(),T3(),T4() and its associated U1(),U2(),U3(),U4() (order depends upon the thread sleep or task.deley you have mentioned in each of those) to complete before it goes on to execute TALL() and ALL() in the sequence. Hence below two statement is the last to print
To be run after T1, T2, T3, T4
To be run after U1, U2, U3, U4
Since you have await Task.WhenAll(t1, t2, t3, t4);
this ensures T1(),T2(),T3(),T4() and its associated U1(),U2(),U3(),U4() (order depends upon the thread sleep or task.deley you have mentioned in each of those) to complete before it goes on to execute TALL() and ALL() in the sequence. Hence below two statement is the last to print
To be run after T1, T2, T3, T4
To be run after U1, U2, U3, U4
answered Mar 8 at 7:27
AsifAsif
594
594
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058356%2fawait-some-functions-and-continue-to-run-some-code-while-waiting-for-task-whenal%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You are actually waiting for all continuations to finish not their target tasks...
– Johnny
Mar 8 at 7:16
If I wait all on T#, the U# will not be called right after T functions are done.
– ca9163d9
Mar 8 at 7:22