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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:33:01+00:00 2026-05-15T09:33:01+00:00

I am still fairly new to parallel computing so I am not too sure

  • 0

I am still fairly new to parallel computing so I am not too sure which tool to use for the job.

I have a System.Threading.Tasks.Task that needs to wait for n number number of tasks to finish before starting. The tricky part is some of its dependencies may start after this task starts (You are guaranteed to never hit 0 dependent tasks until they are all done).

Here is kind of what is happening

  1. Parent thread creates somewhere between 1 and (NUMBER_OF_CPU_CORES – 1) tasks.
  2. Parent thread creates task to be run when all of the worker tasks are finished.
  3. Parent thread creates a monitoring thread
  4. Monitoring thread may kill a worker task or spawn a new task depending on load.

I can figure out everything up to step 4. How do I get the task from step 2 to wait to run until any new worker threads created in step 4 finish?

  • 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-15T09:33:02+00:00Added an answer on May 15, 2026 at 9:33 am

    You can pass an array of the Tasks you’re waiting on to TaskFactory.ContinueWhenAll, along with the new task to start after they’re all done.

    edit: Possible workaround for your dynamically generated tasks problem: have a two-step continuation; every “dependent task” you start should have a chained ContinueWith which checks the total number of tasks still running, and if it’s zero, launches the actual continuation task. That way, every task will do the check when it’s done, but only the last one will launch the next phase. You’ll need to synchronize access to the “remaining tasks” counter, of course.

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

Sidebar

Related Questions

I'm still fairly new to rails so I'm not sure what I'm missing here.
I am still fairly new to EDI, and learning it on a new job.
I'm still fairly new to T-SQL and SQL 2005. I need to import a
I'm still fairly new to ASP.NET development so bear with me. I'm going to
I'm still a newbie to Adobe Air/Flex, and still fairly new with SQL. I've
Still 'diving in' to Python, and want to make sure I'm not overlooking something.
I still very new using Subversion. Is it possible to have a working copy
Im still fairly new to Django, so please explain things with that in mind.
I'm still fairly new to PInvoke calls, so I'm hoping that someone out there
I'm still fairly new to Python and I'm trying to get used to its

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.