|
From: Konstantin S. <kon...@gm...> - 2010-07-05 10:21:21
|
On Mon, Jul 5, 2010 at 2:13 PM, Bart Van Assche <bva...@ac...> wrote: > On Mon, Jul 5, 2010 at 11:32 AM, Konstantin Serebryany > <kon...@gm...> wrote: >> >> +da...@go... >> Julian, Bart, >> >> I've prepared a (draft) message to libstdc++. >> Please review it. You are welcome to edit it directly too. >> http://code.google.com/p/data-race-test/wiki/AtomicReferenceCounting > > While I welcome such an initiative, I have a few comments: > - Asking the libstdc++ maintainers to use ANNOTATE_HAPPENS_BEFORE() > and ANNOTATE_HAPPENS_AFTER() is not an option as long as there exist > three different implementations of these macros (one in > ThreadSanitizer, one in Helgrind and one in DRD). Agree. Shall we do something with this? > - Asking to implement a function __decrement_refcount() will only help > if this function is never inlined. Yes (and this is mentioned in the wiki). We are thinking about ways to avoid this restriction, but currently, yes, you are right. > That will cause a slight slowdown > of every reference counting implementation. I'm afraid that such a > request will not be accepted by the libstdc++ maintainers. > - A nitpick: are you sure that the following statement is correct: > "However, it is hard or impossible to interpret raw atomic > instructions as synchronization" ? There is explanation in the same phrase: (e.g. treating every compare-and-exchange instruction or every instruction with lock prefix as a synchronization event will make the analysis very slow and conservative). Perhaps you could write a more understandable sentence. :) --kcc > While - at least in DRD - it is > easy to associate ordering semantics with all atomic instructions, > doing so would cause many real races not to be reported. > > Bart. > |