Re: [RFC 2/2] rust: sync: Add atomic support

From: Miguel Ojeda
Date: Thu Jun 13 2024 - 13:23:27 EST


On Thu, Jun 13, 2024 at 6:31 PM Boqun Feng <boqun.feng@xxxxxxxxx> wrote:
>
> So let's start with some basic and simple until we really have a need
> for generic `Atomic<T>`. Thoughts?

I don't want to delay this, but using generics would be more flexible,
right? e.g. it could allow us to have atomics of, say, newtypes, if
that were to be useful.

Is there a particular disadvantage of using the generics? The two
cases you mentioned would just be written explicitly, right?

One disadvantage would be that they are different from the Rust
standard library ones, e.g. in case we wanted third-party code to use
them, but could be provided if needed later on.

Cheers,
Miguel