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 8219425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:09:19+00:00 2026-06-07T13:09:19+00:00

Is it possible for the TaskFactory to not run a task for a long

  • 0

Is it possible for the TaskFactory to not run a task for a long time if there are too many tasks queued up already? If so, there a way to configure the taskfactory so that it is able to run more tasks quicker.

Also, will there be any issues with using both the TaskFactory and the Threadpool.QueueUserWorkItem within the same process? We have some older libraries that still use the Threadpool class.

  • 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-07T13:09:21+00:00Added an answer on June 7, 2026 at 1:09 pm

    Using TPL, your task will enter the thread pool automatically; where the thread pool keeps tabs on the number of running threads it will run simultaniously. Too many active threads will kill performance with adminastrative burden on the OS. Once the predefined limit on the number of threads is reached they are then queued. Some background…

    The thread pool starts out with one thread in it pool and the pool manager ‘injects’ new threads to cope with extra asynchronous workload, upto some limiting maximum. After a set period of inactivity the pool manager may ‘retire’ threads if it ‘thinks’ that doing so will lead to a better throughput. In your case above the pool manager is limiting the number of concurrent threads.

    You can set the upper limit on the number of threads the pool will create by calling Thread.Pool.SetMaxThread;, the defaults are:

    1023 in Framework 4.0 in a 32-bit environment.
    32768 in Framework 4.0 in a 64-bit environment.
    250 per core in Framework 3.5.
    25 per core in Framework 2.0.
    

    [these figure may vary according to hardware and OS].

    The reason for these vast number (at least in the case of .NET 4.0) is to ensure that progress is made even when some threads are blocked (running some intense work etc.)

    You can set the lower limit via ThreadPool.SetMinThreads. The role of this limiter is more subtle than that of the max limiter: this instructs the pool manager not to delay the creation of threads until reaching this lower limit on number – setting this number will improve you concurrency when there are blocked threads.

    You cannot use TPL if you are using an earlier version than Framework 4.0. You could use 4.0 and call QueueUserWorkItem – this (at first glance) should not cause you any problems.

    I hope this helps.

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

Sidebar

Related Questions

Possible Duplicate: Objective C for Windows iPhone development on Windows Is there any way
I am currently trying to use a .net Task to run a long method.
Possible Duplicate: Is there any way to clone a git repository’s sub-directory only? clone
Possible Duplicate: Can a Bash script tell what directory it's stored in? Is there
Possible Duplicate: Difference of create Index by using include column or not using Edit:
I have this code: Dim Tasks As New List(Of Task) Tasks.Add(Task.Factory.StartNew(Sub() 'Do whatever End
Possible Duplicate: git - removing a file from source control (but not from the
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
There are various ways in which to observe exceptions thrown within tasks. One of

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.