[C++] Investigate signal-safe spin lock
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
Abseil claims to have a async-signal-safe spinlock class:
https://github.com/abseil/abseil-cpp/blob/master/absl/base/internal/spinlock.h
This could be used to implement rudimentary mutual exclusion between a signal handler and regular code that sets up or tears down shared resources used by the handler.
The caveat is that signals need (apparently) to be blocked inside the handler before taking the spinlock.
**Reporter**: [Antoine Pitrou](https://issues.apache.org/jira/browse/ARROW-11916) / @pitrou
#### Related issues:
- [[C++] Investigate signal-safe spin lock](https://github.com/apache/arrow/issues/27756) (supercedes)
**Note**: *This issue was originally created as [ARROW-11916](https://issues.apache.org/jira/browse/ARROW-11916). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Research direction
Start by reading Abseil's absl/base/internal/spinlock.h and the superseding issue #27756. Determine whether its spinlock is safe for the signal-handler and regular-code interaction described here, including the need to block signals; done means documenting the result or defining an actionable implementation path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100