How Async Await works without creating new thread

  • Thread starter Thread starter Sudip_inn
  • Start date Start date
S

Sudip_inn

Guest
please explain some one that how async/await work on main thread and give us the feel like routine running in worker thread which save us to freeze UI.

please tell me how Async Await works on main thread which run routine in main thread without creating a new thread but gives us the feeling like worker thread? here GetModelData() routine run on main thread by async await and give us the feel like routine running in another background thread.

var task = _ModelManager.GetModelData(selectDate);
await Task.WhenAll(task);
ResponseContext oResponseContext = task.Result;


2) GetModelData() routine will be called when this line execute var task = _ModelManager.GetModelData(selectDate); or

when this line execute await Task.WhenAll(task); ?

please help me to understand async await. thanks

Continue reading...
 
Back
Top