|
From: Julian S. <js...@ac...> - 2012-08-16 07:05:31
|
> Any word on this? When Valgrind encounters a memory address read/write, is > there any mechanism that can tell us if the address is shared among > threads? I don't think so. Both DRD and Helgrind track this indirectly, but not AFAICS in a way which makes it easy to find out whether the memory is shared. For example, Helgrind keeps track of vector clock constraints on when the next "safe" read and write for the location can be, and DRD (I'd guess) keeps a set of bitmaps for "uncompleted" thread segments that shows which memory locations have been accessed in those segments. You might be better off implementing some kind of shadow memory arrangement which tracks the sharedness state of each cache line, a kind of MESI protocol in software. For shadow memory implementations you might find this useful: http://valgrind.org/docs/shadow-memory2007.pdf J |