Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • E emper
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • i4i4
  • manycore
  • emper
  • Merge requests
  • !160

Fix race condition in io::Stats

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Florian Schmaus requested to merge flow/emper:fix-io-stats into master Apr 11, 2021
  • Overview 0
  • Commits 2
  • Pipelines 5
  • Changes 5

The workerStats std::vector was modified concurrently without being synchronized. The Stats are constructed together with IoContext and the worker IoContexts are constructed concurrently at the beginning of the worker loop. And in the Stats constructor the workerStats std::vector was modified by adding the Stats instance that is currently being constructed to it.

Turns out, we don't need the workerStats data structure at all. We simply provide the global and worker IoContexts to io::Stats::printStats(). This results IMHO in a cleaner design of printStats() since there is no longer a data structure called workerStats, that in fact, not only holds the worker's stats. And while we at it, we rename io::Stats::printWorkerStats() to io::Stats::printsStats(), since it does, in fact, not only print the worker stats, but more or less all related worker stats.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix-io-stats