seqlock: Enforce C11 Atomics
Pull Request Summary
This pull request aims to enhance the existing seqlock implementation by making it more portable, improving code readability, and adhering to coding standards. The changes involve modifications to both the Makefile and the seqlock code itself.
Changes Made
Makefile Enhancements
- Added compilation flags to improve code quality and compliance:
-Wextra: This flag enables additional warnings beyond-Wall, helping catch potential issues in the code.-pedantic: Enforced strict adherence to the C standard, promoting standardized and portable code.
Code Improvements
- Transitioned to using
<stdatomic.h>for atomic operations, which enhances synchronization and makes the code more standardized. - Employed
atomic_thread_fencefor memory barriers, enhancing portability across different architectures. - Replaced architecture-dependent inline assembly instructions with standardized atomic operations. This improves cross-architecture compatibility and maintainability.
- Revised the
ATOMIC_COPYmacro to utilize atomic load and store operations for atomic data copying.
Data Types and Typedefs
- Redefined the
seqlock_ttype using_Atomic(uint32_t)to ensure atomic access to the variable, further improving synchronization.
Motivation
These enhancements were motivated by the goal of creating a more reliable and maintainable seqlock implementation. The changes aim to address portability concerns across various architectures while improving the overall readability and standardization of the codebase.
Request for Review
Kindly review the changes made in this pull request. Your feedback is highly valuable, and any suggestions for further improvements are welcome.
Thank you for considering this pull request.
Best regards, scc Feel free to customize the context further to suit the specifics of your project and the details you'd like to emphasize.
Remove
seqlock/tests, which was generated.
I'm sorry for that commit. I fixed it.