0

in my main application C++ builder, I create thread (Object TThread) to process file when i have a file in the list. At same times, I need to keep the number of running thread.

i don't see how to do that? Any suggestion?

Thank you.

  • Any idea?! At same time.. just I need to run x number thread until finish.. –  Sep 26 '14 at 13:53

1 Answers1

0

You know when you are creating a new instance of your thread class. Simply keep a counter of how many instances you create. When each thread finishes, you can use its OnTerminate event to decrement your counter.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770