I've not done any thread programming before, so i wanted to ask you guys for some design suggestions and also about stuffs i should be aware of about thread programming.
Environment: MFC/C++, VS2005
Problem: I have a vendor library running threads to poll data and receive reports from devices. Number of threads can reach 100+ depending on the number of devices. Everytime a thread receives data, it needs to call a sequence of functions(from a vendor SDK, not thread safe) to update values on the GUI.
Solution??: My friend suggested me to use a thread with a built in queue to synchronize updating data to the GUI. Whenever the other threads receives data, it'll add an entry to the queue in this thread. This thread will then call the sequence of functions until the queue is empty and wait for new entries.
I did some reading on _beginthreadex(), _endthreadex(), boost::thread, semaphore and mutex concept. How do you think i should implement this? What pitfalls i should be aware of? Please advise.