Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Why not use compiler builtins atomic #9848

Open
oolongoo opened this issue Dec 31, 2024 · 2 comments
Open

[Feature] Why not use compiler builtins atomic #9848

oolongoo opened this issue Dec 31, 2024 · 2 comments

Comments

@oolongoo
Copy link

Describe problem solved by the proposed feature

gcc和llvm都提供了builtin的atomic方法,为什么还需要自己实现一套 rt_hw_atomic_xxx ?

Describe your preferred solution

直接使用编译器的builtin atomic
https://llvm.org/docs/Atomics.html
https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html

Describe possible alternatives

No response

@aozima
Copy link
Member

aozima commented Dec 31, 2024

有的时候直接用 RT_USING_STDC_ATOMIC,没有的时候用自己实现的。

@kaidegit
Copy link
Contributor

只能说并不是所有时候都能用到支持内置原子的编译器的,再说了不是给了个选项用内置的嘛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants