You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where: src/lib.rs:859-865 (handle_rsgi) and src/dispatch.rs:360.
Currently:
On every single request in handle_rsgi:
let(in_flight, max_c) = {let st = this.state.read();(Arc::clone(&st.in_flight), st.max_concurrency.load(...))};
And immediately afterwards, inside try_rsgi_sync_short_circuit:
let snapshot = state.read().hot_snapshot();
in_flight and max_concurrency are Arc<AtomicUsize> whose pointer never changes after App creation. Acquiring state.read() twice per request causes unnecessary reader lock contention and cache-line bouncing under multi-threaded concurrency.
Fix direction:
Store in_flight and max_concurrency directly on App (or acquire the read lock once and pass the snapshot into try_rsgi_sync_short_circuit).
Activity
Merge pull request #263 from QueryaHub/issue-256-avoid-rwlock-contention
ZhuchkaTriplesix commentedon Oct 18, 2026
Resolved by #263