Strand: per-strand implementation with shared mutex pool#271
Strand: per-strand implementation with shared mutex pool#271sgerbino merged 1 commit intocppalliance:developfrom
Conversation
|
An automated preview of the documentation is available at https://271.capy.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-04-29 13:41:59 UTC |
|
GCOVR code coverage report https://271.capy.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-04-29 13:57:17 UTC |
Replace the shared-impl strand pool with a per-strand implementation backed by a shared pool of mutexes. Removes the bucket-collision class where independent strands sharing a slot serialized against each other and compared equal. - strand_impl is per-strand, allocated by the service - Service holds a 193-mutex pool, hashed by impl address mixed with a per-service salt; collisions share a mutex, never pending work - Coroutine invoker keeps the impl alive via its frame parameter; invoker frames recycle through a single-slot per-service cache, closed under a kCacheClosed sentinel during shutdown - Service tracks live impls via intrusive_list for shutdown traversal - Service back-pointer in strand_impl is atomic so the destructor's load pairs with shutdown's store Adds doc/strand-spec.md (design contract) and doc/strand-rationale.md (why the redesign was needed). Tests: equality non-collision regression, cross-strand independence, transient strand lifetime via weak_ptr expiry, many-strands stress, deterministic mutex-pool collision isolation.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #271 +/- ##
===========================================
- Coverage 92.35% 92.35% -0.01%
===========================================
Files 168 168
Lines 9354 9414 +60
===========================================
+ Hits 8639 8694 +55
- Misses 715 720 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 10 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Replace the shared-impl strand pool with a per-strand implementation backed by a shared pool of mutexes. Removes the bucket-collision class where independent strands sharing a slot serialized against each other and compared equal.
Adds doc/strand-spec.md (design contract) and doc/strand-rationale.md (why the redesign was needed).
Tests: equality non-collision regression, cross-strand independence, transient strand lifetime via weak_ptr expiry, many-strands stress, deterministic mutex-pool collision isolation.