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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:41:22+00:00 2026-06-06T19:41:22+00:00

I would like to know if there is an existent framework which can manage

  • 0

I would like to know if there is an existent framework which can manage some “tasks”.

I’m aware of Task Parallelism, but (correct me if I’m wrong) I don’t think it fits my needs (mostly because it works on a finished list of tasks).

The base of my needs is that I want to give to X threads some work to do.

But:

  • Every task can generate create new tasks to be executed in the future(can be 0 task like it can be 100 tasks
  • If my task list is empty, I would like that my non-working thread wait that all thread have finished their task, maybe I’ve one last thread running, which will generate 50 new tasks that other 3 threads can handle.

Do you know something which can helps me? Or should I have to manage everything by hands?

  • 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-06T19:41:23+00:00Added an answer on June 6, 2026 at 7:41 pm

    TPL would work by the sound of it. You can create subtasks, and you can use WaitAll to make sure all tasks are completed.

    This way you don’t have to worry about thread management, either.

    Without knowing much more about your code, it seems like it could be something like this pseudocode:

    //for loop to create tasks
    var task = new Task(()=>Task.Factory.StartNew(()=>dostuff));
    taskList.Add(task)
    //end for loop
    
    Task.WaitAll(taskList);
    

    UPDATE:

    I also forgot that the subtasks need to be marked at inner tasks or else the outer task will not wait. Here is an MSDN on nested tasks and how to work with them. But, in a nutshell, when you create a nested task you have to mark it as attached to the parent task.

    TaskCreationOptions.AttachedToParent
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if there is anyway I can compare two columns
I would like to know if there is any way I can apply 100%
I know there are other similar questions, but I would like to know specifically
I would like to know if there is some way to share a variable
I would like know if there is an order defined in which attributes and
I would like to know if there is maybe a finally that i can
I would like to know if there's an efficient algorithm to find the greatest
I would like to know if there are any xml coding standards. <?xml version=1.0?>
I would like to know if there are any templates for doing this in
I would like to know if there is any managed or unmanaged library for

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.