Understanding Async and Await
To understand Async and Await, first we need to understand about 'Task'. Task - This is used create thread but it will create thread from the thread pool and not from the computer operating system unlike normal Thread object in c# does. This is used to perform async operations 1. Task<TResult> - This return is used when the async method that returns a value. 2. Task - This return type is used when the async method does not return any value. 3. void - This return type is used for an event handler. We saw that concurrency refers to, in one way or another, doing several things at the same time. That concept of concurrency encompasses parallel programming and asynchronous programming. Parallel programming refers to the use of multiple threads simultaneously to solve a set of tasks. For this, we need processors with adequate abilities to perform several tasks at the same time. In general, we use parallel programming to gain speed. Asynchronous programming refers to the e...
Comments
Post a Comment