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

  • SEARCH
  • Home
  • 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 5979873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:43:16+00:00 2026-05-22T21:43:16+00:00

How can I allocate more threads per task from TPL? I want to investigate

  • 0

How can I allocate more threads per task from TPL? I want to investigate if I set this to bigger value I can get a better performance.

Now I see my app is using max 14 threads and cpu is max 13% in use (core i7).

And second how can I check how many threads is currenty specified for a task?

  • 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-05-22T21:43:17+00:00Added an answer on May 22, 2026 at 9:43 pm

    There is a built in extension point called the TaskScheduler. The default task scheduler uses .NET thread pool threads and several heuristics to determine the optimal number of threads to use to process the tasks that are queued up to it. More info on the default implementation is available here on MSDN (see section titled The Default Task Scheduler).

    If you create your own TaskScheduler implementation you can control exactly how many threads you want to allocate, when they’re allocated, on what cores, etc. There’s a sample here on MSDN on how to do this, but you’ll find more complete and varied sample implementations in the Parallel Extensions Xtras.

    All that said, I’d be surprised if you can beat the default implementation. If you’re doing any I/O, make sure you’re taking full advatange of async I/O APM APIs with Task.FromAsync.

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

Sidebar

Related Questions

In C++, if you want to dynamically allocate an array, you can do something
Can I change the field public virtual ClassOne ClassOne { get; set; } to
The CLR Profiler can also reveal which methods allocate more storage than you expected,
I want to allocate more memory to program.l What is the gcc flag that
Do you have any idea of how can I make this function more time-efficient?
I want to force the Linux kernel to allocate more memory to applications after
I have a server application that, in rare occasions, can allocate large chunks of
In C, I know I can dynamically allocate a two-dimensional array on the heap
When you allocate an array using new [] , why can't you find out
Can anyone let me know how can we change the value of kendo combobox

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.