On 2/16/21 9:46 PM, Richard Biener wrote:
Looks like this can only shrink the race window.
Yes, kind of.
Don't you need atomic accesses or locking here? Can the number of counters
change?
So what we do: we want to stream out N TOPN counters where each looks like this:
{total_count, number_of_tracked_values, pointer_to_first_tracked_value }
Where tracked values live in a linked list and we always append to a linked
list.
What happens is that number of tracked values in a linked list does not match
number_of_tracked_values.
I'll write it even more robust...
IIRC the counters are dynamically allocated. Are they ever reallocated?
No, they live in a linked list.
Martin