Skip to content

feat(bytesbuf): impl ThreadAware for GlobalPool#273

Open
sandersaares wants to merge 4 commits intomainfrom
sandersaares/thread-aware-global-pool
Open

feat(bytesbuf): impl ThreadAware for GlobalPool#273
sandersaares wants to merge 4 commits intomainfrom
sandersaares/thread-aware-global-pool

Conversation

@sandersaares
Copy link
Member

Summary

Make GlobalPool internally thread-aware by replacing std::sync::Arc<GlobalPoolInner> with thread_aware::Arc<GlobalPoolInner, PerCore>. This gives each core its own independent pool on relocation, providing better UX and integration into thread-isolated runtime environments.

Changes

  • Added thread_aware dependency to bytesbuf crate (with derive feature)
  • Changed GlobalPool.inner from Arc<GlobalPoolInner> to thread_aware::Arc<GlobalPoolInner, PerCore>
  • Derived ThreadAware for GlobalPool
  • Updated allowed_external_types to include thread_aware types exposed in public API
  • Added ThreadAware static assertion and relocation smoke test

Notes

  • No API breaking changes — GlobalPool::new(), reserve(), Clone, Debug, Memory, and MemoryShared all continue to work identically
  • The only addition is the new ThreadAware impl
  • Block release across threads continues to work safely because each GlobalPoolInner sub-pool uses Arc<Mutex<...>>

Closes #270

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (5cae290) to head (ad8466e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #273   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         141      141           
  Lines        8626     8631    +5     
=======================================
+ Hits         8626     8631    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

⚠️ Breaking Changes Detected


--- failure auto_trait_impl_removed: auto trait no longer implemented ---

Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
        ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/auto_trait_impl_removed.ron

Failed in:
  type GlobalPool is no longer UnwindSafe, in /home/runner/work/oxidizer/oxidizer/crates/bytesbuf/src/mem/global.rs:39
  type GlobalPool is no longer RefUnwindSafe, in /home/runner/work/oxidizer/oxidizer/crates/bytesbuf/src/mem/global.rs:39

If the breaking changes are intentional then everything is fine - this message is merely informative.

Remember to apply a version number bump with the correct severity when publishing a version with breaking changes (1.x.x -> 2.x.x or 0.1.x -> 0.2.x).

@sandersaares sandersaares force-pushed the sandersaares/thread-aware-global-pool branch from 0c6ed70 to 605e7c6 Compare February 18, 2026 15:44
@sandersaares sandersaares marked this pull request as ready for review February 18, 2026 15:46
@sandersaares sandersaares force-pushed the sandersaares/thread-aware-global-pool branch from 605e7c6 to 491072d Compare February 18, 2026 15:52
Make GlobalPool internally thread-aware by replacing std::sync::Arc<GlobalPoolInner>
with thread_aware::Arc<GlobalPoolInner, PerCore>. This gives each core its own
independent pool on relocation, providing better UX and integration into
thread-isolated runtime environments.

Closes #270

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sandersaares sandersaares force-pushed the sandersaares/thread-aware-global-pool branch from 491072d to f5212ba Compare February 18, 2026 15:52
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.

feat(bytesbuf): impl ThreadAware for GlobalPool

2 participants

Comments