Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pw_multisink: Interface to read entries count
Bug: 355104976 There is use case of pw_multisink that drain the sink in a "batched" pattern, where it is drained only when close to full. The draining thread is put to sleep until a close-to-full signal. In such workload, the draining thread needs to know how much entries it needs to pop out in each wakeup. Otherwise, if 1) entry pop speed and push speed is close, and 2) remaining entries count in pw_multisink is low, the draining thread will temporaly "stream". "stream" does not fully utilize resources for batched pattern, e.g. allocated buffers. Test: Added unit tests Change-Id: I440eeb90af51afb04ee9bbbc5cb3b1cd90607241 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/226351 Lint: Lint 🤖 <[email protected]> Reviewed-by: Taylor Cramer <[email protected]> Commit-Queue: Taylor Cramer <[email protected]>
- Loading branch information