Merge patch from JeremyF:

32-hg-lifetime-segments

HELGRIND: implement the algorithm described in "Runtime Checking of
Multithreaded Applications with Visual Threads". Rather than working
with thread IDs, this algorithm breaks the lifetime of a thread up
into thread lifetime segments, and arranges them in an interference
graph.

If a memory location is in exclusive state and it is touched by
another thread, it compares the TLSs of the old owner and the new
thread. If the two TLSs can't possibly overlap in time (for example,
one TLS is the parent before a child thread is created, and the other
TLS is the child thread) the memory location's ownership is
transferred rather than moving it into a shared state. This allows a
parent thread to set up some memory and then create a new child,
handing ownership of that memory to the child, without generating
spurious errors.

At present the only synchonization events used to create new TLSs are
thread create and thread join, though in principle any synchronization
event would work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1305 a5019735-40e9-0310-863c-91ae7b9d1cf9
3 files changed