rte_atomic_*_explicit

Morten Brørup mb at smartsharesystems.com
Thu Jan 25 23:10:47 CET 2024


> From: Mattias Rönnblom [mailto:hofors at lysator.liu.se]
> Sent: Thursday, 25 January 2024 19.54
> 
> Why do rte_stdatomic.h functions have the suffix "_explicit"?
> Especially
> since there aren't any wrappers for the implicit variants.
> 
> More to type, more to read.

They have the "_explicit" suffix to make their names similar to those in stdatomic.h.

You might consider their existence somewhat temporary until C11 stdatomics can be fully phased in, so there's another argument for similar names. (This probably does not happen as long as compilers generate slower code for C11 stdatomics than with their atomic built-ins.)

> 
> When was this API introduced? Shouldn't it say "experimental"
> somewhere?

They were introduced as part of the migration to C11.
I suppose they were not marked experimental because they replaced something we didn't want anymore (the compiler built-ins for atomics, e.g. __atomic_load_n()). I don't recall if we discussed experimental marking or not.


Reverse paper trail:
https://git.dpdk.org/dpdk/log/lib/eal/include/rte_stdatomic.h
https://patchwork.dpdk.org/project/dpdk/patch/1692738045-32363-2-git-send-email-roretzla@linux.microsoft.com/
https://patchwork.dpdk.org/project/dpdk/patch/1692738045-32363-2-git-send-email-roretzla@linux.microsoft.com/



More information about the dev mailing list