Should I use Helgrind or DRD for thread error detection?

Jeff Terrell Ph.D. picture Jeff Terrell Ph.D. · Nov 16, 2011 · Viewed 7.8k times · Source

Looks like Valgrind has two tools that both do thread error detection: Helgrind and DRD. These tools are substantially similar.

My primary question is: when should I use one instead of the other to check my multi-threaded code?

More broadly, why are there two tools? I assume they aren't entirely redundant. What are the important differences? Should I generally plan on running my code through both tools?

Answer

Bart Van Assche picture Bart Van Assche · Nov 24, 2011

While Helgrind can detect locking order violations, for most programs DRD needs less memory to perform its analysis. Also, DRD has support for detached threads. There are more subtle differences too - compare the respective manuals if you want to know more. See also http://valgrind.org/docs/manual/hg-manual.html and http://valgrind.org/docs/manual/drd-manual.html.