|
From: Julian S. <js...@ac...> - 2010-01-27 16:24:10
|
Konstantin, I'm trying to annotate a user-implemented barrier, using http://code.google.com/p/google-perftools/source/browse/trunk/src/base/dynamic_annotations.h specifically ANNOTATE_HAPPENS_BEFORE and ANNOTATE_HAPPENS_AFTER like this void barrier_wait ( barrier* b ) { ANNOTATE_HAPPENS_BEFORE(b); // the barrier implementation ANNOTATE_HAPPENS_AFTER(b); } But this doesn't work well, and I think it's not clear what semantics you intended for these two. This situation I can understand: T1: AH_BEFORE(obj) T2: AH_AFTER(obj) then we get an edge T1->T2 But what about this? T1: AH_BEFORE(obj) T2: AH_BEFORE(obj) T3: AH_AFTER(obj) Should we get edges T1->T3 and T2->T3, or only T2->T3 ? IOW, does a call AH_BEFORE(obj) cause obj to "forget" about any previous AH_BEFORE calls on it? It seems to me that to annotate a barrier properly requires generating two edges in this example, not just one. (Plus then it requires a way to tell obj to "forget everything" when the barrier is reinitialised, so that subsequent uses of it do not end up generating edges back to previous uses.) J |