|
From: Konstantin S. <kon...@gm...> - 2009-06-01 07:30:04
|
On Sat, May 30, 2009 at 3:02 PM, Julian Seward <js...@ac...> wrote: > > Ok in principle, but some comments: > >> > Adding support for the ANNOTATE_*() macro's in drd/drd.h is probably >> > not too hard. I'll have a look at it. >> >> Implementation-wise you need to support Annotate*() functions, or >> rewrite ANNOTATE*() macro's using client requests and support those >> client requests. >> I find the approach with Annotate*() functions simpler to maintain. > > I prefer that the basic thing that is implemented and documented to > be the ANNOTATE_* macros, not the Annotate*() functions. The macros > can be implemented with just a header file, like the Memcheck macros. > The functions require shared objects etc and therefore create a > dependency on a new library (IIUC), which isn't desirable. This will give us source-level compatibility. If we also want binary-level compatibility between Helgrind/DRD/ThreadSanitizer we will have to define the implementation of these macros. > > There are a lot of these requests, which is a big overhead w.r.t. > verifying that the implementation is correct and keeping it correct. > Are they all really necessary? I wonder if you can implement these > using a smaller subset, based on the idea of sending an abstract message > between threads. > > Suppose you had a > > ANNOTATE_SENDTO_SYNC_OBJECT(address) and > ANNOTATE_RECVFROM_SYNC_OBJECT(address) > > which create a h-b edge through the sync object. How many of these > requests could be implemented using just those two? Just those two. For pure happens-before detector you will probably need only BENIGN_RACE and IGNORE_* in addition to SENDTO/RECVFROM. For hybrid you need much more. Pure h-b is easy to use due to low false-positive rate, but it misses ~half of the races (and is also less predictable). So, ThreadSanitizer supports both modes and needs the full set of annotations. --kcc > > J > |