Question

I have a client server application with multi-threading. The server side is failing with a std::list getting corrupted resulting in a SEGV. I suspect that there is some kind of cross thread timing issue going on where the two threads are updating the std::list at the same time and causing it to be corrupted.

Please suggest free tools to track this down or strategies that might be helpful.

Was it helpful?

Solution

If you know the shared data structure that is being corrupted due to concurrent access, then put a Mutex on the Data Structure so that only one Thread can access at a a time, then try again.

You need to make sure that no shared data can be updated by concurrent threads. It is OK for multiple threads to read, You do need to be careful of multiple threads reading and one or more writing.

Can you specify what OS you are using and which compiler ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top