hung-doan / .bookmarks

My life bookmarker
0 stars 0 forks source link

async await note #61

Open hung-doan opened 5 years ago

hung-doan commented 5 years ago

await Task => won't lock calling thread ? Task.Wait will lock calling thread ?

await async won't create new thread

await vs wait will cause deadlock ?

hung-doan commented 5 years ago

In ASP .NET will cause deadlock (not in .NET core)

Task.Factory.StartNew(async() => { await Task.Delay(1000); }).Wait();