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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:33:50+00:00 2026-06-02T16:33:50+00:00

This may not be suitable here, please feel free to move, shout or abuse

  • 0

This may not be suitable here, please feel free to move, shout or abuse if so.

We currently have a console application that get started by another and passed in an ID of the ‘job’, this job will have multiple records that need to be processed. A simple explanation of the flow would be;

Starts 50 threads

Gets records to be processed.
if records > 0 see what threads are not still busy and send it some information.
if records = 0 update something else and exit.
Get more records.
Loop.

Now, I am looking to convert this into a ‘polling’ service that is continually running and when new records are available, process them. To take what I have and convert this is fairly simple, but the threads stuff is old and probably outdated.

I was looking to refactor most if not all and use Task.Parallel to process the items. However, I am struggling to get a suitable framework for polling and then processing the items and was looking for suggestions on how to achieve this.

Pretty vague I know, but hopefully enough to give some kind of input.

Many thanks

  • 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-02T16:33:51+00:00Added an answer on June 2, 2026 at 4:33 pm

    From my experience and this msdn quote:

    More efficient and more scalable use of system resources.

    Behind the scenes, tasks are queued to the ThreadPool, which has been
    enhanced with algorithms (like hill-climbing) that determine and
    adjust to the number of threads that maximizes throughput. This makes
    tasks relatively lightweight, and you can create many of them to
    enable fine-grained parallelism. To complement this, widely-known
    work-stealing algorithms are employed to provide load-balancing.

    You simply shouldn’t care about how many tasks is a good number, or how to create a system where you load balance the threading involved.

    Simply use:

    Task.Factory.StartNew(() => DoSomeWork());
    

    Every time you want to run something asynchronously, it does all the smart job behind the curtain.

    Now since you’re likely to create tasks in a loop, please be extra-careful not to introduce a closure bug many people had (including me), which you can look up here.

    I have a windows service that runs from 1 to 500 Tasks, and never had trouble.

    Hope this helps,

    Bab.

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

Sidebar

Related Questions

This may have been answered elsewhere but I could not find a suitable response.
this question may have been asked many times, but could not find any suitable
This question may not directly relate to programming. I have noticed that the technology
This may seem a basic question but my is not currently working. I am
This may not be the correct way to use controllers, but I did notice
This may not be a programming question, but I don't know where to ask
This may not be the kind of question one should ask on StackOverflow, but
This may not be possible for the carousel but is there a way to
Sorry, this may or may not be a programming question directly, but I am
Okay, This may be really simple or it may not even be possible, or

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.