What is differences Between Task And Thread?Explain with example.
Answers (1)
Add AnswerThread
In C#, the Thread class produces a real operating system thread. The Thread class uses resources like memory for the stack and CPU overhead for context shifts from one thread to another to generate a thread.
In Simple words, Thread gives you full control over any process or program that you are running.
Task
In C#, a Task class is used to define an asynchronous system-level task. Tasks generated with the Task class are executed by the task scheduler. The job is run by the default scheduler inside the thread pool. Tasks, unlike threads generated with the Thread class, do not require any additional memory or CPU resources.
I hope you will like my answer.😄
Here is the answer.