Skip to content

Fix shared memory stats with threads#1408

Open
wcawijngaards wants to merge 5 commits intomasterfrom
stats-shm-volley
Open

Fix shared memory stats with threads#1408
wcawijngaards wants to merge 5 commits intomasterfrom
stats-shm-volley

Conversation

@wcawijngaards
Copy link
Member

@wcawijngaards wcawijngaards commented Feb 20, 2026

Fix statistics with shared memory. The total was added by the threads and thus the partial total is exposed while the threads add up. The thread 0 wipes the total, but is not guaranteed to be the first, so the total contains stats from different time periods. The fix is there to stop that.

The mesh_time_median stat value is fixed to add up to the correct average that is used, as well.

The stat interval is selected so that threads have stat timer callbacks at the same time. The threads use the same time offset in the interval for that.

The stat totals are collected together in a separate struct. When it is done, the struct with totals is copied into the shared memory area.

Fixes #152 . Since the totals are added together properly before the copy to the shared memory. If some threads are not responding, the total does not get updated during that time, but gets updated afterwards.

@wcawijngaards wcawijngaards self-assigned this Feb 20, 2026
@wcawijngaards wcawijngaards requested a review from gthess February 20, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared memory statistics are not reliable

1 participant