-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Parent Epic: #62
What
Add concurrency primitive patterns to rust-performance SKILL.md. Currently covers async but not lower-level concurrency.
Sections to Add
- Lock-Free Data Structures -- crossbeam epoch-based reclamation, concurrent queues
- Data Parallelism with Rayon --
par_iter(), parallel chunking, custom thread pools - Atomic Operations -- Ordering levels (Relaxed/Acquire/Release/SeqCst), when to use each
- Thread Pool Configuration -- Custom stack sizes, thread naming, affinity
- Cache Locality in Concurrent Code -- Avoiding false sharing, padding for cache lines
Source Reference
Section 8 (Concurrency Patterns) from RUST_SYSTEM_PROGRAMMING_BEST_PRACTICES.md
Disciplined Engineering Alignment
| Phase | Skill | Concurrency Relevance |
|---|---|---|
| Research | disciplined-research |
Profile existing code for parallelism opportunities; identify shared-state contention points |
| Design | disciplined-design |
Specify concurrency strategy (rayon vs crossbeam vs atomics); document memory ordering requirements; design cache-friendly layouts |
| Implementation | disciplined-implementation |
Implement lock-free structures with safety invariants per step; rayon integration as separate step from correctness |
| Verification | disciplined-verification |
ThreadSanitizer on all concurrent paths; stress tests with loom for atomic ordering; benchmark parallel vs sequential |
| Validation | disciplined-validation |
Validate throughput under production load patterns; verify no deadlocks/livelocks under sustained stress |
The SKILL.md should note:
- During research: profile for Amdahl's law -- identify serial bottlenecks before parallelizing
- During design: specify memory ordering rationale for every atomic operation
- During verification:
loomand TSan are mandatory for lock-free code
Relevance to Terraphim
Terraphim uses Aho-Corasick automata with parallel text processing. crossbeam and rayon patterns are directly applicable to search pipeline performance.
Acceptance Criteria
- SKILL.md updated with concurrency section including code examples
- crossbeam and rayon added to crate recommendations
- Benchmark template extended for concurrent workloads
- Disciplined workflow integration notes included
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request