|
From: Nicholas N. <nj...@cs...> - 2008-02-20 21:08:40
|
On Wed, 20 Feb 2008, Julian Seward 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. I think you're both missing the point. If you say "this memory shouldn't be shared", Helgrind could warn as soon as the memory leaves the exclusive state. Currently, Helgrind won't warn about memory shared unintentionally unless there's a race involved. Judging from Julian's comment, this mightn't make much difference to speed, but it would give stronger checking. Nick |