Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout mode for ostream / istream #29

Open
malachib opened this issue Mar 2, 2024 · 1 comment
Open

Timeout mode for ostream / istream #29

malachib opened this issue Mar 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@malachib
Copy link
Contributor

malachib commented Mar 2, 2024

Distant relative of #25 , but different

There appears no getting around the blocking nature of ostream / istream. Somewhat baked into the design, so we need a timeout provision. A crude (and probably outdated and broken) polling one exists (see FEATURE_ESTD_OSTREAM_TIMEOUT)

Augmenting aforementioned crude method, we also want a signaling mechanism. Something like FreeRTOS event group indicating more or less CTS, RTS,.

Noteworthy is underlying streambufs appear 100% happy as nonblocking and can stay that way.

@malachib malachib added the enhancement New feature or request label Mar 2, 2024
@malachib
Copy link
Contributor Author

malachib commented Mar 6, 2024

A lot of progress here, but pausing because:

  1. It's a real rabbit hole
  2. 80%+ of this behavior can be approximated by adding a blocking mode (keeping non blocking mode too) to streambufs

Will resume when the true power of signaling comes to fore, which is:

  1. Opportunity for streambuf-owned bipbuffer to participate in zero-copy scenarios, quite convenient
  2. Finer grained control of timeouts
  3. Potentially more optimal sleeping/blocking of thread vs a spinwait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant