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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:54:05+00:00 2026-05-23T12:54:05+00:00

I am working on a project that deals with a few tasks running in

  • 0

I am working on a project that deals with a few tasks running in parallel.

The number of tasks to be processed is generally ~200 and those of that can be parallel is about 10

I am considering using TPL because it simplifies a lot of details also because it provides a way to control the degree of concurrency with custom TaskScheduler and such.

However, I am also trying to find a nice to have feature that lets me know that a particular thread is asking for more work and that the ThreadPool’s queue is empty and it does not have any more work to steal from other threads.

Can this be done?

EDIT 1
I was not clear the first time. Each time I can only queue about 50 tasks to the ThreadPool and we don’t want to wait until the entire 50 items are done processing.

  • 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-23T12:54:05+00:00Added an answer on May 23, 2026 at 12:54 pm

    However, I am also trying to find a nice to have feature that lets me know that a particular thread is asking for more work and that the ThreadPool’s queue is empty and it does not have any more work to steal from other threads.

    Unfortunately, the inner workings of the ThreadPool are not exposed publically. There is no way to hook into this specific information.

    That being said, the ThreadPool works as a single cohesive unit – local work queues really only matter when a single thread pool thread starts a new Task, since the new task gets added to that thread’s local work queue. The “ThreadPool’s queue is empty and it does not have any more work to steal from other threads” will only occur when the entire ThreadPool is done processing, which, if you’re the one adding the work, will happen as soon as all of your work is done. This is fairly easy to check for…


    Edit:

    I was not clear the first time. Each time I can only queue about 50 tasks to the ThreadPool and we don’t want to wait until the entire 50 items are done processing.

    If you’re using the TPL, you can just queue up the entire workload. By using a custom TaskScheduler (or even the default, which would just rely on the ThreadPool’s pooling), you’ll automatically get pooling of resources, which prevents too many work items from being processed at once. As your work load processes, more items will automatically get scheduled…

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

Sidebar

Related Questions

I am currently working on a project that deals with a vector of objects
I am working on a PHP project that deals with storing a set of
I am working on a research project that deals with social networks. I have
I'm working on a project that deals with cars. I need to know if
I am working on a project that deals with reading and processing huge .txt
I am working on a project that deals with migration of Oracle db to
I am working on a project that deals with analyzing a very large amount
I am working on a project for school that deals with overflowing buffers (the
I'm working on a project that deals with lots of people editing binaries, and
I'm working on a Flash project that deals with multiple files. There is a

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.