What is the correct way to determine the number of running/busy threads (thread_count)?

I think you need to go buy a basic book on threaded programming.

This list is not that book.

----

Not sure the reason for that comment. Mine seems a logical approach and is almost working. My only other experience with threading was with Python and it had a similar method called threading.active_count()

So my logic (while maybe wrong) is to:

1. Get the number of cores using boost::thread::hardware_concurrency()
2. Fill a std::queue container with jobs for the threads.
3. While the container is not empty and there are less active threads than boost::thread::hardware_concurrency(), then start a new thread.

Again, not sure why that would be deserving of a condescending response, it seems logical.




Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now.