Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8320815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:47:29+00:00 2026-06-08T22:47:29+00:00

If you decide to offload some CPU intensive code from the UI thread by

  • 0

If you decide to offload some CPU intensive code from the UI thread by putting it in a task and running it in the Thread Pool, would this code itself ever benefit from using the “await” keyword?

It sort of seems like the answer is “no”..

I mean, one of the main reasons to await Tasks in the UI thread is to free the UI thread back up to do what it was doing before. If you await as Task while running on a Thread Pool, what are you freeing up that thread to do?

Am I missing something really obvious?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:47:31+00:00Added an answer on June 8, 2026 at 10:47 pm

    If you decide to offload some CPU intensive code from the UI thread by putting it in a task and running it in the Thread Pool, would this code itself ever benefit from using the “await” keyword?

    Just for a CPU-intensive task? Maybe not.

    But that’s not the only reason to run code in thread pool thread.

    Consider a web server – all the requests will be handled in thread pool threads… and by using await while processing those requests (e.g. while waiting for a database or other web service response) you can handle millions of requests on very few threads.

    Additionally, even in a rich GUI scenario, you might want to put some long-running task onto a thread-pool thread, but still launch multiple asynchronous requests from that thread. The way that async/await encourages composition of asynchronous operations makes it entirely reasonable to write your code in a way which is asynchronous whichever thread it happens to run on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Going to decide where to put some of the initialization code. There seems to
I am trying to decide the best way to structure some code. I will
how do you decide whether to put code in a subroutine or in main
If I decide to place this in my .htaccess file: IndexIgnore */* RewriteEngine ON
Attempting to decide on how to implement our RPC on the server side. From
I'm trying to decide whether to switch from Vows to Mocha for a large
Take this scenario: I decide to 'fork' a codebase on github.com, and start doing
If you decide to sign your code, you'll need: signcode.exe makecert.exe cert2spc.exe pvk2pfx.exe What's
Note: I couldn't decide whether this was more appropriate for Stack Overflow or Serverfault,
I've decided to offload some of my UI generation to my back-end, and stream

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.