-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Test wtperf
-
Storage Engines
-
8
-
2023-12-12 - Heisenbug, 2024-01-09 - I Grew Tired
-
v8.0
WiredTiger uses __wt_spin_backoff() to dynamically backoff when waiting for a resource. It spins for a few cycles, then yields, then falls back to sleeping.
The goal is to respond quickly if the resource becomes available soon, but not use too many resources if it takes a while for the resource to become available.
The downside is that repeatedly calling yield still takes time, and sleeping can run longer than it takes for the resource to become available – sleep doesn't end when the resource is available.
Linux futexes provide a user-level mechanism for one thread to wait for an event triggered by a different thread and should avoid the overheads of our current spin-and-backoff approach.
We should evaluate the feasibility of using futexes in WiredTiger – both in terms of code simplification and readability and performance.
A downside is that futexes are only available on Linux. This is probably our primary platform, but not the only one we run on.
- is related to
-
WT-11940 Review the use of __wt_yield (sched_yield)
- Backlog
- related to
-
WT-13125 Add waitable_atomic API
- Backlog
-
SERVER-81797 Make our own portable implementation of atomic notify() and wait() with timeout support
- Closed