Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sundaram SubramanianRank #150 · 15.2K reputationPosted Jun 26, 2017, 3:58 AM EDT
Threadis a lower-level concept: if you're directly starting a thread, you know it will be a separate thread, rather than executing on the thread pool etc.Taskis more than just an abstraction of "where to run some code" though - it's really just "the promise of a result in the future". So as some different examples:Task.Delaydoesn't need any actual CPU time; it's just like setting a timer to go off in the futureWebClient.DownloadStringTaskAsyncwon't take much CPU time locally; it's representing a result which is likely to spend most of its time in network latency or remote work (at the web server)Task.Run()really is saying "I want you to execute this code separately"; the exact thread on which that code executes depends on a number of factors.Manikandan MurugesanRank #300 · 8.4K reputationPosted Jun 26, 2017, 8:11 AM EDT
Manikandan MurugesanRank #300 · 8.4K reputationPosted Jun 26, 2017, 8:13 AM EDT
Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 27, 2017, 4:02 AM EDT