q1) does Task.Run creast async task? (it is writen it runs on an other thread.)
q2) if it does create async task then why and when we need Task.Run(async ()={}).
pls explan with examples.
q1) does Task.Run creast async task? (it is writen it runs on an other thread.)
q2) if it does create async task then why and when we need Task.Run(async ()={}).
pls explan with examples.
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 attend5days leftRegister
Deepika SawantRank #242 · 10.2K reputationPosted Jul 15, 2025, 11:59 AM EDT
Q1: Does
Task.Runcreate an async task?Yes, but with a nuance.
Task.Runqueues work to the thread pool and returns aTaskthat represents that work.awaitinside the delegate allows the thread to be released during I/O-bound operations.Q2: Why and when do we use
Task.Run(async () => { ... })?This pattern is useful when:
async.When NOT to use
Task.Run(async () => { ... })awaitthe async call directly.Jack Abroy16 reputationPosted Jul 17, 2025, 4:34 AM EDT
Use
asyncto write clear, non-blocking code that naturally handles asynchronous work.Task.Runjust offloads work to a threadasyncis better for I/O tasks and responsiveness.