On Thu, May 28, 2009 at 9:12 AM, Ivan Novick <[email protected]> wrote:
> Hi,
> I would like to detect cases of false sharing in my program.
> By this I mean cases where multiple threads are both trying to write data to
> different memory locations but those locations are closest enough in memory
> that they are on the on the same cache line.
> The result would be delays on threads even though there are enough CPU's to
> do the work.
> Are there any tools in valgrind to do this?

No, but it wouldn't be too hard to write a new one that did this.  For
each cache-line-sized chunk of memory, you'd record which thread last
wrote to it and when, and then if another thread wrote to a chunk
sufficiently soon after a previous thread you'd give a warning.  You
could record thread numbers and addresses and stack traces and the
like, there'd be trade-offs in how much overhead you'd have vs. how
much info you'd get in each report.

Nick

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to