open-telemetry / open-telemetry/opentelemetry-cpp
SpinLockMutex : pause/yield instruction covering all the architectures/platforms
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 632
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 75
Description
Describe your environment
Currently SpinLockMutex implementation performs std::atomic_bool.load() operation in loop until the lock is acquired. This will starve other logical CPU cores sharing the same load-store unit as the spinning core. To overcome the issue, it executes yield/pause instructions specific to architecture and/or platform in between as below:
This ticket is raised to explore whether all the scenarios are covered and if not add yield/pause instruction for that platform/architecture.
Steps to reproduce
As above
What is the expected behavior?
All the platforms need to be covered.
What is the actual behavior?
There is TODO in code to add missing instructions for other platforms/archictecture.
Additional context
None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with api/include/opentelemetry/common/spin_lock_mutex.h around lines 90-105, where SpinLockMutex loads the atomic flag and selects architecture- or platform-specific yield/pause instructions. Review the existing branches and TODO to determine which supported platforms or architectures are missing coverage; done means the relevant scenarios are covered without leaving the TODO unresolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100