Overview
Helgrind is a Valgrind tool for detecting synchronization errors in C, C ++ and Fortran, which use POSIX pthreads threading primitives.
The main abstractions in POSIX pthreads are: a set of threads, a common address space, a thread creation, a thread join, a thread exit, mutexes (locks), variable conditions (event notifications between threads), reader-writer locks, spin locks, semaphores and barriers.
Helgrind can detect three error classes, which are discussed in detail in the following three sections:
- Misuse of the POSIX pthreads API.
- Potential deadlocks due to locking ordering issues.
- Mountains of data - access to memory without corresponding locking or synchronization.
Such problems often lead to irreproducible, time-dependent failures, blockages and other abnormal behavior, and can be difficult to find in another way.
Helgrind knows about all pthread abstractions and tracks their effects as accurately as possible. On x86 and amd64, it understands and partially handles implicit blocking arising from the use of LOCK prefix instructions.
Helgrind works best when your application uses only the POSIX API pthreads. However, if you want to use custom threading primitives, you can describe your Helgrind behavior using the ANNOTATE_ * macros defined in helgrind.h. This functionality was added in Valgrind Release 3.5.0, and is considered experimental.
Since Boost.Threads is based on POSIX pthreads (at least on Linux), I would assume that this would work for him as well.