On Wednesday 20 February 2008 08:15, Bart Van Assche wrote: > On Feb 19, 2008 10:09 PM, Nicholas Nethercote <[EMAIL PROTECTED]> wrote: > > But programmers should know in advance which bits of memory should be > > shared. Perhaps some client requests could be used which say "this > > section of memory will be shared" or "this section of memory won't be > > shared" could be useful. In the "won't be shared" sections the checking > > might be a lot simpler? > > Sounds nice, but a very important task for data race detection tools > is to detect which data is shared between threads unintentionally.
For Helgrind-style schemes, data that is accessed only by one thread stays in the exclusive state, and the state machine actions for exclusive states are cheaper than for shared data, since there is no need to do lockset intersections or threadset unions for Excl states. So to some extent, there already is a less-expensive (I won't say fast :-) handling case for data which is never shared. But anyway. A flag which says "assume all stack accesses are thread-local" would drastically cut the number of references to be checked, and might be a useful addition. I think old Helgrind had such a feature. The only real difficulty is deciding for sure what is and isn't a stack access at JIT time (basically impossible, we'd need a run-time filter too). J ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers