I was pondering on a per-path counter...
From
Chris M. Thomasson@chris.m.thomasson.1@gmail.com to
comp.lang.c++ on Thu Oct 23 14:02:13 2025
From Newsgroup: comp.lang.c++
Per path can be for a given program source code, and the paths can take
after static analysis... It creates a re-instrumented form, and runs it
with a thread that monitors its per thread paths. When all paths are
hit, it can halt... ;^)
For the per path counters starting at 0, we want to say okay they were
hit, and we need a count, but still always show that they were hit.
Think of a counter rolling over back to 0. Uggg. Therefore, this atomic
algo might work for a per-path counter:
p = fetch_add_relaxed(counter, 0x2);
if (p == 0) fetch_or_relaxed(counter, 0x1);
These per path counters would be for each path in a re-instrumented
program. Just want it to say hit, and allow for a counter that might roll... --- Synchronet 3.21a-Linux NewsLink 1.2