- task is asynchronous operation
- thread is abstraction on OS thread
Further read:
https://www.c-sharpcorner.com/article/task-and-thread-in-c-sharp/
About coding and whatnot
Further read:
https://www.c-sharpcorner.com/article/task-and-thread-in-c-sharp/
Further read:
In short: no.
Longer explanation:
Deferred Procedure Call
DPC
schedules Asynchronous Procedure Call
APC
notifies thread that I/O write is doneI recommend reading this post: https://blog.stephencleary.com/2013/11/there-is-no-thread.html. This will explain the topic much better than I can.
Further read:
AsyncOperation.Result
Result
while child method waits for parent thread to take control, after being done with async I/OFurther read:
https://medium.com/rubrikkgroup/understanding-async-avoiding-deadlocks-e41f8f2c6f5d
https://stackoverflow.com/questions/15021304/an-async-await-example-that-causes-a-deadlock
Asynchronous programming patterns in .NET:
Ways of achieving asynchronous code in .NET
Task
class API (Run
, WhenAll
, WhenAny
, etc.)ThreadPool.QueueUserWorkItem(ThreadProc);
Further read:
https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/