Hi All,
I have a assignment to write a thread safe Pro C++ program.The requirement,
1.There is a table name A contains the records to process.
2.Main thread should pick the records(unique in nature) from this table and assigning it to the available threads to process.
3.After processing the thread should report to the main thread that, its ready to accept the new requests.
4.If the thread is still not reported, main thread should assign the request to next available thread like that.
Please provide your views and ideas.
Thanks in advance.
I dont have source codes on it.My query is, as per the requirement I thought of using thread pool concept .but not sure since I am new to the multithreading concept. So If you have any idea in what ways it can be done ,please share the details.
You'll need to define your unit of work in a Task, then pass the Task to the ThreadPool, where the Task is executed. That's the way these things tend to work.
There are a few open source threadpool implementations around.