Skip to content

Conversation

salkinium
Copy link
Member

@salkinium salkinium commented Aug 2, 2025

IOStream would not yield when BlockIfFull behavior was used (the default for all our boards). But yielding when full would create interlaced output from different fibers, so I implemented a mutex that only unlocks on newlines. So all fibers will wait until one entire line has been produced, then yield. So this now only blocks fibers that wait on the logger output, and not all fibers in the system. The change is backward compatible for when not using fibers.

Other changes:

  • Prevent a circular header dependency due to IOStream being referenced everywhere.
  • std::scoped_lock is not enabled in the stdlibc++ for GCC14. Dunno why, but couldn't fix it in any way.
  • Tested in Hardware
  • Documentation

The implementation does not seem to be available for every GCC.
@salkinium salkinium added this to the 2025q3 milestone Aug 2, 2025
@salkinium salkinium force-pushed the feat/fiber_logging branch 5 times, most recently from cc13ef9 to 06d10d0 Compare August 3, 2025 08:44
IOStream is used almost everywhere
@salkinium salkinium force-pushed the feat/fiber_logging branch 2 times, most recently from 31e9248 to 790d31b Compare August 3, 2025 11:36
@salkinium salkinium force-pushed the feat/fiber_logging branch from 790d31b to 7d9070d Compare August 3, 2025 13:07
@salkinium salkinium merged commit 7d9070d into modm-io:develop Aug 3, 2025
12 checks passed
@salkinium salkinium deleted the feat/fiber_logging branch August 3, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant