|
From: Julian S. <js...@ac...> - 2006-09-13 19:48:58
|
On Wednesday 13 September 2006 20:33, Bart Van Assche wrote: > I think the algorithm outlined below will work. Computing the danger set at > each context switch will take some CPU time, It might be possible to compute the danger set lazily. Rather than, at each context switch, constructing the union of relevant access sets, just remember which sets need to be unioned. Then, build parts of the union on demand and cache the result. This means that very short segments are not burdened with the potentially overwhelming cost of building the entire set at once. In effect it changes the cost per context switch from O(size of access sets of all segments unordered relative to this one) to O(the number of different memory locations this segment will visit) which sounds like a worthwhile improvement. > but has the big advantage that > precise call stacks can be reported without having to store a call stack > for each memory access. There is a difference however between reporting > races at the end of a segment versus reporting them immediately: when > reporting each race immediately, it becomes possible that the same data > race is reported more than once (e.g. when the same address is accessed > repeatedly in a loop). Probably care will have to be taken to ensure that > each race is only reported once. Yes. I agree. One cheap way to do this would be, once an error is reported for an address, remove that address from the danger set, so any further accesses to it in the remainder of this segment's run will not be reported. J |