Reputation: 31
Using ContinueWith on the task I executed is suppose to run asynchronously, but is it really asynchronous? I mean if I run a task "t" and use that task to call say t.ContinueWith(t=>t.Result), will this be run asynchronously? I know it won't block all the threads till result is complete but will it completely return the handle back to the caller or will it do context switching between threads.
Upvotes: 0
Views: 59
Reputation: 244797
Using ContinueWith on the task I executed is suppose to run asynchronously, but is it really asynchronous?
Yes.
I mean if I run a task
t
and use that task to call sayt.ContinueWith(t=>t.Result)
, will this be run asynchronously?
Yes.
I know it won't block all the threads till result is complete but will it completely return the handle back to the caller or will it do context switching between threads.
I don't know what handle are you talking about. What ContinueWith()
does is to schedule the continuation to execute when the Task
completes and then immediately returns.
Upvotes: 2