how to create and maintain a thread pool class using C++

Hi all,

please refer to this link
http://en.wikipedia.org/wiki/Thread_pool_pattern
this is what exaclt i want to implement in my C++ code.


i have a list of files in a directory. I want to take validate all those files one by one. I want to create some threads(say 10) and each one has to take a file and then it has to perform some validation. Once its done then it has to take the next one. Like that all the threads has to perform the task. I want

1. How to create a thread class in C++.
2. how to allocate the jobs for those threads.
3. Once job got over how will i come to know the job is over?
4. Once the job over how will i allocate one more job?

please kindly help with some example.please help me in this..
Check out the Boost Thread Library.
http://code.google.com/p/cppthreadpool/downloads/list

chk this out, works nicely. superb clean code
Topic archived. No new replies allowed.