|
From: Julian S. <js...@ac...> - 2010-03-08 15:26:47
|
On Monday 08 March 2010, Konstantin Serebryany wrote: > On Mon, Mar 8, 2010 at 2:14 PM, Julian Seward <js...@ac...> wrote: > >> Can you please clarify how the proposed new annotation > >> ANNOTATE_HAPPENS_BEFORE_OVERWRITE() differs from > >> ANNOTATE_HAPPENS_BEFORE() and why it would be useful ? > > > > I don't know; these are Konstantin's annotations; > > Hm. Are they? Err, my mistake. Sorry. Yes I did propose these. But I think we should just forget them, and stay with ANNOTATE_HAPPENS_BEFORE and ANNOTATE_HAPPENS_AFTER. The motivation was for the correct annotation of barriers directly using h-b edges. But it's better to directly do so with ANNOTATE_BARRIER_*. The original idea was that, for a barrier, we have some abstract sync object (the barrier) which needs to acquire an h-b edge from each incoming thread. Then, when all the threads leave the barrier, they all take a h-b dependency from the sync object. So for the thread-arrival handling, ANNOTATE_HAPPENS_BEFORE is not the correct thing for the 2nd and subsequent arriving threads, because it throws away any previous h-b edge associated with the barrier. What we need is to accumulate h-b edges in the barrier; in VTS terms take the join (vector max) of all the VTSs of the threads arriving at the barrier. Hence the distinction between A_H_B_OVERWRITE(x), which copies the calling thread's VTS into 'x', and A_H_B_ACCUMULATE(x), which joins the calling thread's VTS into 'x'. J |