In .NET Core, a Task represents an asynchronous operation that can be scheduled on a thread pool thread. When an asynchronous operation is started, it returns a Task object that can be used to monitor the progress of the operation or to wait for its completion. Task objects provide a number of methods for working with asynchronous operations, such as ContinueWith and WhenAll.
On the other hand, a Thread represents an independent path of execution within a process. When a thread is started, it begins executing code on a separate call stack. Unlike Task, Thread objects are not specifically designed for asynchronous operations, although they can be used for that purpose. However, using Thread directly for asynchronous operations is generally discouraged in favor of Task or other asynchronous programming patterns, because it can result in inefficient use of system resources.
Welcome to triksbuddy blog. He we discuss on different technology, tips and tricks, programming, project management and leadership. Here we share technology tutorials, reviews, comparison, listing and many more. We also share interview questions along with answers on different topics and technologies. Stay tuned and connected with us and know new technologies and dig down known ones.
Tuesday, April 18, 2023
What is a Task in .NET Core and how does it differ from a Thread?
Labels:
.Net,
.NET Core,
Interview Question,
OOP
Welcome to triksbuddy blog. He we discuss on different technology, tips and tricks, programming, project management and leadership.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Please keep your comments relevant.
Comments with external links and adult words will be filtered.