looking for multithread debugging tools

Started by
4 comments, last by Kylotan 15 years, 10 months ago
hi everyone, last week, I solved a bug about multithread loading resource, it's a thread safety problem,it takes me much time, you know... I want to know is there some tools can help multithread debugging? when you run your program,the tool do some record about cpu slice allocation for your progress, when bugs replicate,the tool will use this record to force cpu do the same slice allocation to your progress,then you can replicate your bug, is there somes tools like this? or is there some tools could help replicate multithread bugs? thanks a lot
Advertisement
No, I don't think such tools exist. But they're not really necessary anyway. The best way to fix concurrent programming problems is to use correct synchronisation between threads - lock shared resources, use copies of data to reduce sharing, etc. If you code it properly, such bugs are impossible.
Quote:Original post by Kylotan
If you code it properly, such bugs are impossible.

If we all coded properly we wouldn't need debuggers at all, multithreaded or not.

To the OP:
I'm not aware of such a tool, the idea is cool though. But for the time being such a tool is pure fantasy. You can go ahead and code it yourself, the is definitely a market for such a thing :)

You might want to check out Intel Thread Checker 3.1 for Windows. There is another version for Linux available as well. I haven't used it myself, but its claims are impressive. It works from inside Visual Studio (2003 up)

Quote:Intel Thread Checker 3.1 for Windows.
# Detects hidden potential errors such as deadlocks and data races, mapping them to the source-code line, call stack, and memory reference
# Displays useful warnings for effective threaded application diagnosis, highlighting the most potentially severe errors
# When using supported Intel® compilers and source instrumentation mode, tracks the error down to the specific variable in your source code
# Comprehensive error detection mitigates the risk of adding threads and enables hands-on learning about the fundamental principles of threading


There is an evaluation download at the link above. The full product seems a little pricy, but there is student/academic discounts available.
They also have a thread profiler product.
thanks Moomin,this tool seems very powerful,as it's described,I think the tool will very helpful.
Quote:Original post by Deaken Frost
Quote:Original post by Kylotan
If you code it properly, such bugs are impossible.

If we all coded properly we wouldn't need debuggers at all, multithreaded or not.


The point is that correctness of concurrent programs is something you can easily prove mathematically, and that even once a problem is found, merely catching it in the debugger is rarely sufficient to tell you what needs to change or why. It's quite a different problem to most other issues you get in software development and should really require a different approach. Debugging tools and the like are the wrong approach.

This topic is closed to new replies.

Advertisement