multithreading - What to use to wait on a indeterminate number of tasks? -


I'm still quite computing because I'm not even sure to use the tool for working parallel new.

I have a system.Threading.Tasks.Task that has to wait for the number of tasks to end before the start of this difficult part after this task (You are never guaranteed to hit 0 dependent functions unless they are all done) may start some of their dependencies.

Here's what's going on

  1. Parent thread produces between 1 and (NUMBER_OF_CPU_CORES - 1).
  2. Parent thread creates a surveillance thread
  3. Monitoring thread is a worker Depending on the task of killing or loading the work, a new task can be laid.

I can figure out the steps above to step up to step 4 until I wait to run until any new worker thread is made in phase 4 finish Get work from 2?

After

you can pass an array of code> work after you all The task is to begin, to wait on the new task is along with it.

Edit: Potential solution for the problem of your dynamically-generated tasks: Continuing a two-step; Every "dependent work" you started should be infected continue which still checks the total number of ongoing tasks, and if it is zero, then the actual continuity function is launched. In this way, every task completes the check, but only the last step will launch the next step. You will definitely need access to the "Rest of the Job" counter.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -